how am i suppose to make a choice for the cancel_option of
showInputDialog method?
lets put in this way
in the showConfirmDialog like this
confirmation = JOptionPane.showConfirmDialog(null, "You Want To Procced Or Not?", "Confirmation", JOptionPane.YES_NO_CANCEL_OPTION); switch (confirmation) { case JOptionPane.YES_OPTION: JOptionPane.showMessageDialog(null, "YES!"); break; case JOptionPane.NO_OPTION: JOptionPane.showMessageDialog(null, "NO!"); break; case JOptionPane.CANCEL_OPTION: JOptionPane.showMessageDialog(null, "CANCEL!"); break;
how about in showInputDialog?
String widthInput = JOptionPane.showInputDialog(null, "Between 100 And 500 Pixels Inclusive: ", "Width Of The Shape", JOptionPane.WARNING_MESSAGE);
i cant make a switch Statement for a String value...
so in case i press the cancel button
theres an output that will display..
everytime i press the cancel button , the compiler shows me this
[COLOR="Red"]Exception in thread "main" java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Integer.java:417) at java.lang.Integer.parseInt(Integer.java:499) at preDefinedClassesApplications.Ch5DrawShape.inputDimension(Ch5DrawShape.java:216) at preDefinedClassesApplications.Ch5DrawShape.getShape(Ch5DrawShape.java:47) at preDefinedClassesApplications.Ch5DrawShape.start(Ch5DrawShape.java:34) at preDefinedClassesApplications.Ch5DrawShape.main(Ch5DrawShape.java:274) [/COLOR]