0

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!

3
  • What do you mean by "Query" script. Do you have an action listener on your exit button? Commented 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. Commented May 22, 2012 at 21:30
  • You might need to post some code, default exit operation should work. Commented May 22, 2012 at 21:33

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Well kind of. I want it to run a method when i hit the exit button though

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.