Canceling Events
Is anybody know how to canceling event ?
the case is like this :
user click the [x] button on the top right of the windows. it will return an close event right? and how do we cancel it ? (cancel the close event)
Is anybody know how to canceling event ?
the case is like this :
user click the [x] button on the top right of the windows. it will return an close event right? and how do we cancel it ? (cancel the close event)
If you mean like have a pop-up dialog asking if one is sure they want to exit, then you will have to user your own listener. Like for the JFrame, set the default close operation to Do Nothing On Close then add a window listener that will "respond" to a close event where in it's window close method will have the code you write that will give the appropiate dialogs to either continue or cancel.