Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kuhaylah Malik   on Mar 06 In Java Category.

  
Question Answered By: Katrina Edwards   on Mar 06

Maybe try something like this in your JFrame constructor:

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addWindowListener( new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
//TODO: - Call your Exit Action Code from here
}
} );

( or else use your JFrame object to make these calls.... )

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Basic Swing question Or get search suggestion and latest updates.


Tagged: