Let's suppose two JDialogs, j1 and j2, and I need j2 to be closed when I hit the "X" button on the j1.
I tried to implement WindowListener on j1, and I used j2.dispose()
in the windowClosing()
and the windowClosed()
methods but it didn't work.
Is it possible to put an actionPerformed on the "X" button for example? or is it possible to do it using a windowListener and how?
Thank you in advance.