0
Why when I close a JOptionPane, does It give me an exception?
Sorry if is bad written.
4 Antworten
+ 1
There are dozens of exceptions that can get thrown by the JOptionPane class - show us the code and maybe we can help
Or at least what kind of exceptional you're getting.
+ 1
OK I'll try to run the code post my findings :)
0
try{
int num = Integer.parseInt(JOptionPane.showInputDialog("Number: "));
JOptionPane.showMessageDialog(null,"Your number: " + num);
}catch(Exception e){
JOptionPane.showMessageDialog(null, "That's not a number");
}
0
When I close the JOptionPane that asks for a number, I get the exception I have for an invalid value.