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!
            Asked
            
        
        
            Active
            
        
            Viewed 156 times
        
    0
            
            
        - 
                    What do you mean by "Query" script. Do you have an action listener on your exit button? – dann.dev May 22 '12 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 May 22 '12 at 21:30
 - 
                    You might need to post some code, default exit operation should work. – dann.dev May 22 '12 at 21:33
 
1 Answers
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.
- 
                    Well kind of. I want it to run a method when i hit the exit button though – BaconMan97 May 22 '12 at 21:42