How to stop window closing in "internalFrameClosing" event.

Ads
 

How to stop window closing in "internalFrameClosing" event.

In an internal frame listener in the internalFrameClosing event I want to ask the user to confirm closure with a JDialog. The default close operation for the Internal Frame is "DO_NOTHINg. If the dialog answer is "YES" I just do frame.dispose() and it works. If the answer is "NO" I do frame.doDefaultCloseAction() which leaves the frame open as expected. However it always leaves the JDialog visible. If I do not do "frame.doDefaultCloseAction()" then the whole internal frame will close anyway. I have tried making the Dialog invisible or disposing it but it is still there. Is there a way to abort the frame closing event so the user can go back and save their work or do further edits? Thankyou for your assistance

View Answers

Ads









Related Tutorials/Questions & Answers:
How to stop window closing in "internalFrameClosing" event.
How to stop window closing in "internalFrameClosing" event.  In an internal frame listener in the internalFrameClosing event I want to ask the user... it but it is still there. Is there a way to abort the frame closing event so the user can go back
window closing
window closing  hello, In my project i have login,logout... script. and i need one solution that,when ever user trying to close browser window... call how to achive this requriment. Thank you
Advertisements
Closing the browser window
Closing the browser window  <BODY> <form> <input type=button value="Close Window" onClick="javascript:window.close();"> <...; thought that this will close the window of the browser but not working
how to stop audio (mp3)
how to stop audio (mp3)   if(e.getActionCommand(). equals("Stop... have to stop a song. on writing player.close() it pauses the song rather than stopping it. how should i stop the song keeping in mind i have to play another song
Closing any kind of browser window without confirmation using javascript
Closing any kind of browser window without confirmation using javascript  Here is my requirement, I have to close a browser window on onload event. I have tried with window.close() and self.close(). But it doesn't work. Please
closing the internet explorer window of any version without confirmation using javascript
closing the internet explorer window of any version without confirmation using javascript  Hi all, Here is my requirement, I have to close microsoft internet explorer window on onload event without confirmation. It should
Java window state event
Java window state event  Two java windows, one on top of another... Window at the back is deactivated when the other is on the top. Can iconify when there is only one window using win+d key. In windows, press win+d, window
Java how to stop audio
Java how to stop audio  hello i have this code in the main: try { AudioInputStream audio = AudioSystem.getAudioInputStream(new File...); } I want that when i press the stop button in the gui, the audio stops
How to make a closing eyes, make a closing eyes, closing eyes
How to make a closing eyes     ... eye to closing eye. You will learn here how is it made possible... will find an animation window, now adjust all the layer one by one
How to Make iPhone Window Application
How to Make iPhone Window Application  Hi, For Making iphone window application, what parameters i have to follow or provide example related to iphone window application. Thanks
how to solve 'Stop Running This Script' Error ?
how to solve 'Stop Running This Script' Error ?  Hi.. When opened the page on IE browser(version : 8.0),it gives an java script error (i.e.Stop Running This Script). I have used jsp/servlet for this. Please help to resolved
how to focus on the new window opened from JSF ?
how to focus on the new window opened from JSF ?  Hi guys, I have commandLink with action which using javascript to open a new window(window.open()). Problem is, the new window opens at background behind the current window
Window
Window  how to create an window of a person like regestration form
how to use a JInternalFrame in a JFrame to create a chat window in a client/server app?
how to use a JInternalFrame in a JFrame to create a chat window in a client/server app?  how to use a JInternalFrame within a JFrame? i want... with JDeskTopPane but i want a chat window which can be moved within the app(just like
What are events? Explain how Event handling in Java?
What are events? Explain how Event handling in Java?  What are events? Explain how Event handling in Java?   Hi, The Events..., and introduces us to AWT event handling. For Details about Event Handling in Java
How to stop java scripting engine when the script being run is taking too much time?
How to stop java scripting engine when the script being run is taking too much time?   How to stop java scripting engine when the script being run is taking too much time? for e,g, in case of infinite loop the memory is getting
how to add audio clip in swings with event handling
how to add audio clip in swings with event handling  hello dear, i wanna to play audio clip in java program in JFrame in swings by event handling... how it can be done...... thanks alot
Flex terminating event flow example
;    In the example below, how to terminate an event flow... statements as arguments are passed in two different event handlers to stop.... Methods stop the event object on moving to next node or task, here the task
how to use mysql event scheduler in hibernate
how to use mysql event scheduler in hibernate  Hi all, I am creating... of time, i need to use mysql event scheduler My query is like this create event...("); it gives native batch update Exception How can resolve this problem can
stop repetition
stop repetition  i want to know use of Hashmap, and its contains key... record more than one time. so could u please guide me how to handle this problem... they have same id so i want to stop repetition
ModuleNotFoundError: No module named 'stop'
ModuleNotFoundError: No module named 'stop'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'stop' How to remove the ModuleNotFoundError: No module named 'stop' error
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
How to add tabs in right side of a window from top to bottom in swing s
How to add tabs in right side of a window from top to bottom in swing s  How to add tabs in right side of a window from top to bottom in swings
how to call the parent page from child without refreshing the parent and my parent window uses the master page
how to call the parent page from child without refreshing the parent and my parent window uses the master page   how to call the parent page from child without refreshing the parent and my parent window uses the master page
stop the running hidden server
will need to stop the other process or change the port number(s). how to stop tis...stop the running hidden server  Port 8080 required by Tomcat v6.0 Server at localhost is already in use. The server may already be running in another
How to close a frame on action event of a button from a different class ?
How to close a frame on action event of a button from a different class ?  How to close a frame on action event of a button from a different class... have coded like on action event of these components diff-diff frame get
ModuleNotFoundError: No module named 'stop-words'
'stop-words' How to remove the ModuleNotFoundError: No module named 'stop...ModuleNotFoundError: No module named 'stop-words'  Hi, My Python... have to install padas library. You can install stop-words python
closing connections in finally block
closing connections in finally block  Hi, What will happen if I close connection before closing the resultset in the finally clock? e.g. finally... { ... conn.close(); rs.Close(); } If i do as above ... what will happen
window in center
window in center  if i run the programme thw window is in lie in top left corner i want a window open in center
ModuleNotFoundError: No module named 'multi-thread-closing'
: No module named 'multi-thread-closing' How to remove the ModuleNotFoundError: No module named 'multi-thread-closing' error? Thanks   Hi...ModuleNotFoundError: No module named 'multi-thread-closing'  Hi
ModuleNotFoundError: No module named 'multi-thread-closing'
: No module named 'multi-thread-closing' How to remove the ModuleNotFoundError: No module named 'multi-thread-closing' error? Thanks   Hi...ModuleNotFoundError: No module named 'multi-thread-closing'  Hi

Ads