Results 1 to 6 of 6
- 08-11-2011, 11:11 PM #1
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
To prevent the user to close JOPTIONPANE USING the X button IN IT
I want to prevent the user to close the Joptionpane by clicking the X in the right end corner. I am attching my code for your reference. The requirement is even if the user click the X in optionpane it should not close.
Code:
optionsConfirm[0] = new String(EJbundle.getString("YES"));
optionsConfirm[1] = new String(EJbundle.getString("NO"));
int answer = JOptionPane.showOptionDialog(getEJSummTablePanel() , ejRes.getString("161"), ejRes .getString("WARNING_MESSAGE"), JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE, null, optionsConfirm, optionsConfirm[0])
if (answer== JOptionPane.YES_OPTION) { int selectedRow = EJEPanTable.getSelectedRow(); setSelRow(selectedRow); EJNumberHolder ejNumberHolder = getEjNumHolderList().get(getSelRow()); correctSelectedTableRow(correctRequest(ejNumberHol der)); }
if (answer == JOptionPane.CLOSED_OPTION) { If the user click the X button of the JOPTIONPANE it should not close. setdefaultclose operation is in JDialog. I dont know how to implement in JOptionPane }
- 08-11-2011, 11:20 PM #2
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
Please help me to resolve this issue
- 08-12-2011, 02:28 AM #3
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,144
- Rep Power
- 5
1) Don't be so impatient.
2) Learn how to post formatted code
3) Quit crossposting: How prevent the user closing the Joptionpane by clicking the X in the right end corner (Swing / AWT / SWT / JFace forum at JavaRanch)
- 08-12-2011, 02:38 AM #4
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
I thought the code posted makes clear abt my doubt and the problem. My query is about the JOptionPane.CLOSED_OPTION. I appreciate your thoughts..Going forward i will do the same.
- 08-12-2011, 02:43 AM #5
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
if (answer == JOptionPane.CLOSED_OPTION)
{
If the user click the X button of the JOPTIONPANE it should not close.
setdefaultclose operation is in JDialog.
The docs doesnt show how to go for implementation or any in JOptionPane
}
- 08-15-2011, 06:10 PM #6
Member
- Join Date
- Aug 2011
- Posts
- 5
- Rep Power
- 0
Similar Threads
-
override the close button
By shaay in forum AWT / SwingReplies: 4Last Post: 08-29-2010, 03:42 PM -
remove close button
By silversurfer2in in forum AWT / SwingReplies: 8Last Post: 05-31-2010, 10:53 AM -
How do I close a frame with a button?
By Psyclone in forum AWT / SwingReplies: 7Last Post: 02-19-2010, 10:43 PM -
JoptionPane.showmessegeDialog that close after 20 seconds
By itaipee in forum AWT / SwingReplies: 1Last Post: 02-01-2010, 01:47 PM -
Refresh Button Resubmitting Data - How To Prevent This?
By Tirka in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-09-2009, 09:22 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks