Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    At line 14 the program tries to convert the letter "S" to an int value.

    Was the user supposed to enter a letter there ( just before line 14) or a number? If a letter, then the code should not...
  2. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    The Integer class has a method for converting a String to an int.
    Use it after getting the String from the user with the JOPtionPane method.
  3. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    Does it work now?
  4. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    How is the code in post#7 different from the code in post#1?
    I see the Scanner class which needs to be removed.
    The values being returned by JOptionPane methods are not being assigned to variables...
  5. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    Can you post the new code that uses what the JOptionPane methods return and does not use Scanner methods?


    Try debugging the code by adding some println() statements to show the value of...
  6. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    Have you read the API doc for the JOptionPane class and its methods?
    Many methods return what the user has entered.
  7. Replies
    13
    Views
    1,709

    Re: JOptionPane Stops working after user input

    Mixing dialog windows and console input must be very confusing for the user. It would be better to use one or the other.


    Try adding lots of println() statements to the code to show its...
Results 1 to 7 of 7