How can I check when a JFrame has been closed?

前端 未结 1 1930
我在风中等你
我在风中等你 2021-01-25 06:51

How do I check when JFrame window is closed?

MediaPanel mediaPanel=new MediaPanel();
JFrame_of_subtitle frame=new JFrame_of_subtitle(mediaPanel);
JP         


        
1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-25 07:20

    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.

    0 讨论(0)
提交回复
热议问题