Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用了 JDialog 来显示表单(我本可以使用 JFrame,但我有我的理由)。我的应用程序中有一个事件将导致函数生成并显示所述 JDialog。现在,我想知道用户是否关闭了该 JDialog。我怎么知道这个?
PS我的默认关闭操作是 JDialog.DISPOSE_ON_CLOSE。
在对话框上注册一个窗口侦听器,并实现该windowClosed方法,请参阅The Java Tutorial on Window Listeners
windowClosed