How prevent the user closing the Joptionpane by clicking the X in the right end corner
Vinod Joseph
Greenhorn
Joined: Aug 11, 2011
Posts: 1
posted
0
The requirement is if the user clicks the X in JOptionpane it should not close.
In JDialog we have setDefaultCloseOperation but i am not sure what is the functionality that we have to implement in JoptionPane similar to the setDefaultCloseOperation.
optionsConfirm[0] = new String(EJbundle.getString("YES"));
optionsConfirm[1] = new String(EJbundle.getString("NO"));
int answer = JOptionPane.showOptionDialog()
if (answer== JOptionPane.YES_OPTION) { }
if (answer == JOptionPane.CLOSED_OPTION) { If the user click the X button of the JOPTIONPANE it should not close. I know that setdefaultclose operation was in JDialog. But i am not sure how the same/alternative can be implemented in JOptionPane }