Kennywen
asked on
Disable auto close of JOptionPane
sample code as below:
String[] options = {"OK","CANCEL"};
int input = JOptionPane.showOptionDial og(
null, // parentComponent
newRecordPanel, // message
"New", // title
JOptionPane.OK_CANCEL_OPTI ON, // optionType
JOptionPane.PLAIN_MESSAGE, // messageType
null, // icon
options, // options
options[0] // initialValue
);
i will do some validation when user click on OK button, if the validation is fail then the JOptionPane show remain there (do not close it). But how can i disable the auto close of the JOptionPane?
thanks
String[] options = {"OK","CANCEL"};
int input = JOptionPane.showOptionDial
null, // parentComponent
newRecordPanel, // message
"New", // title
JOptionPane.OK_CANCEL_OPTI
JOptionPane.PLAIN_MESSAGE,
null, // icon
options, // options
options[0] // initialValue
);
i will do some validation when user click on OK button, if the validation is fail then the JOptionPane show remain there (do not close it). But how can i disable the auto close of the JOptionPane?
thanks
easiest would be to redisplay pane when validationn fails
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just an example of objects's comment.