Results 1 to 3 of 3
  1. #1
    Torgero is offline Member
    Join Date
    Oct 2008
    Posts
    33
    Rep Power
    0

    Default Control if it is a input

    What I am having problems with is that I need to put in a number (the number of the account), and if there is no input then the text "you have to enter a number".. The problem is that i dont know which method to use to control if a number is written in or not.. This is what i tried:

    PHP Code:
    String TallLest = showInputDialog("LEDETEKST");
    long kontoNummer = Long.parseLong(TallLest);
    		while (kontoNummer == null || kontoNummer.trim().equals("")){
    			showMessageDialog(null, "Du må legge inn.");
    			kontoNummer = showInputDialog("What, what, what...");
    
    		}

  2. #2
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Default

    kontoNummer = showInputDialog("What, what, what...");
    modify as...
    kontoNummer = showInputDialog(null,"What, what, what...");

  3. #3
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

Similar Threads

  1. Focus control in SWT
    By chandransuraj in forum SWT / JFace
    Replies: 0
    Last Post: 01-28-2009, 02:17 PM
  2. Control on exe
    By jazz2k8 in forum New To Java
    Replies: 3
    Last Post: 08-14-2008, 02:06 PM
  3. control app width based on certain control
    By thebillybobjr in forum SWT / JFace
    Replies: 0
    Last Post: 05-15-2008, 04:52 PM
  4. How to remove Control Characters from an input file?
    By renjan in forum Advanced Java
    Replies: 0
    Last Post: 08-01-2007, 03:33 PM
  5. how to take input and verify input in Java programs
    By bilal_ali_java in forum Advanced Java
    Replies: 0
    Last Post: 07-21-2007, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •