I'm writing a very simple elementary math program for practice. Actually, I'm basically taking one of my Programming 1 assignments and writing it with GUI's (frames, panes, etc..). One problem; in my old program, I have the following code:
System.out.printf( "How much is %d times %d ? ", gen1, gen2 );
attempt = input.nextInt();
Where gen1 and gen2 are randomly generated numbers. I've been trying to use a JOptionPane to come up with:
number=JOptionPane.showInputDialog("what is %d times %d?",gen1,gen2);
attempt = Integer.parseInt(number);
But it's not working. I'm guessing theres a different way to display %d in gui panes?
JOptionPane troubles.
Started by DVeck89, Apr 04 2010 02:54 PM
1 reply to this topic


Sign In
Create Account

Back to top









