1

如何检查JFrame窗口何时关闭?

MediaPanel mediaPanel=new MediaPanel();
JFrame_of_subtitle frame=new JFrame_of_subtitle(mediaPanel);
JPanel panel=new JPanel();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
4

1 回答 1

1

You will add WindowListener to your frame.

WindowListener has a windowClosing callback function which will be invoked when your frame is being closed.

You can see this tutorial for sample code.

于 2012-04-29T06:24:28.833 回答