开发者

how to know if JDialog is closed or not?

开发者 https://www.devze.com 2022-12-25 17:10 出处:网络
I have used a JDialog to display a form ( I could have used JFrame, but I have my reasons). There is an event in my application that will cause a function to generate and display the said JDialog. Now

I have used a JDialog to display a form ( I could have used JFrame, but I have my reasons). There is an event in my application that will cause a function to generate and display the said JDialog. Now, I want to know if the user has closed that JDialog. How do I find this out?

P.S. My defaultCloseOperation is 开发者_Go百科JDialog.DISPOSE_ON_CLOSE.


Register a window listener on the dialog, and implement the windowClosed method, see The Java Tutorial on Window Listeners

0

精彩评论

暂无评论...
验证码 换一张
取 消