Question

The code segment below is a part of a bigger program, but I think this is where I'm having the issue. So, I am trying to use a while loop to ask for input over and over until the program is done, and the dialog box is not coming up and I don't know why. I would really appreciate it if someone could take a look and tell me what I'm doing wrong. If you want to see the entire program just tell me.

Code

        boolean done = true;

        while(!done)
        {
            Grid grid = new Grid();
            boolean userDone = true;
            int compRandom = (int) (Math.random() * 9) + 1;

            String input1 = JOptionPane.showInputDialog("Please input a number 1-9 for where you would like to place your piece: ");
                Integer input = Integer.parseInt(input1);
Was it helpful?

Solution

    boolean done = true;

must be

    boolean done = false;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top