Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    7
    Views
    4,423

    Re: JOptionPane using If and Else

    It shouldn't. What you'll need is a way for the user to tell the program that he wants to exit the program. Usually that is done by having the user enter a special value to signal he's done. When the...
  2. Replies
    7
    Views
    4,423

    Re: JOptionPane using If and Else

    Describe what you want to use a loop for.
    Two popular loops:
    for() which can use a variable that is initialized to a value and incremented and tests an ending condition
    while(condition) which...
  3. Replies
    7
    Views
    4,423

    Re: JOptionPane using If and Else

    This won't work.
    opt is a String variable and 1 is an int literal.
    If you want to compare a String to another String, use the equals method.
    If the literal 1 is to be a String enclose it in "1"
Results 1 to 3 of 3