I would like to make my script run a "Query" method when the exit button on my JFrame is pushed. I tried it with set default close operation but that wont work obviously so what should i do? Thanks!
-
What do you mean by "Query" script. Do you have an action listener on your exit button?dann.dev– dann.dev2012-05-22 21:26:22 +00:00Commented May 22, 2012 at 21:26
-
I mean like i want it to have a popup window if you havent saved asking if you want to save. And im talking about like the default JFrame exit button.BaconMan97– BaconMan972012-05-22 21:30:05 +00:00Commented May 22, 2012 at 21:30
-
You might need to post some code, default exit operation should work.dann.dev– dann.dev2012-05-22 21:33:15 +00:00Commented May 22, 2012 at 21:33
Add a comment
|
1 Answer
Why do you say that setDefaultCloseOperiation would not work? Maybe I'm misunderstanding the question, but here is a very similar question on this site.
See if the accepted answer is what you were wanting.
1 Comment
BaconMan97
Well kind of. I want it to run a method when i hit the exit button though