Results 1 to 4 of 4

Thread: [SOLVED] While

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

    Default [SOLVED] While

    PHP Code:
    int resultat = showConfirmDialog(null, "Vil du sette inn penger?");
    
    			if(resultat == YES_OPTION){
    			String tekst = showInputDialog("Hvor mye vil du sette inn:");
    			while(tekst == null || tekst.trim().equals("")){
    				showMessageDialog(null, "Du må legge inn data.");
    
    			}
    
    			double settInn = Double.parseDouble(tekst);
    			showMessageDialog(null, "Penger igjen på konto " + MikeTyson.innskudd(settInn) + " NOK.");
    
    			}
    How can I make the loop so it goes from "Du må legge inn data." to the showinputdialog? Now its just says "Du må legge inn data." and a ok button. If I push ok it just repost the "Du må legge inn data.".
    "Du må legge inn data." = You have to input data..

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

    Default

    Put the same code segment inside the loop.

    Java Code:
    tekst = showInputDialog("Hvor mye vil du sette inn:");

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

    Default Cheers!!

    Thanks... Thanks alot..

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,371
    Blog Entries
    1
    Rep Power
    20

Posting Permissions

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