Matt
Member
- Joined
- Aug 19, 2009
- Messages
- 98
- Reaction score
- 0
- Points
- 6
My code, very sloppy but im newbie and need this done.
JButton[] world = new JButton[2];
world[0] = new JButton("World 1");
world[1] = new JButton("World 2");
int response = JOptionPane.showOptionDialog(null,
"Please choose a world",
"World Select",
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
world,
world[0]);
if (response == 0) {
int cw = cw1;
int cworld = 1;
} else if (response == 1) {
int cw = cw2;
int cworld = 2;
}
I basically want it so the user clicks a button, the form closes and the variables are changed. Thanks, EASY 10 Points!
JButton[] world = new JButton[2];
world[0] = new JButton("World 1");
world[1] = new JButton("World 2");
int response = JOptionPane.showOptionDialog(null,
"Please choose a world",
"World Select",
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
world,
world[0]);
if (response == 0) {
int cw = cw1;
int cworld = 1;
} else if (response == 1) {
int cw = cw2;
int cworld = 2;
}
I basically want it so the user clicks a button, the form closes and the variables are changed. Thanks, EASY 10 Points!