Question

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 JDialog.DISPOSE_ON_CLOSE.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top