So I have 2 JFrames - J1 and J2. J2 is launched by clicking a button on J1. Also when that button is pressed, all other controls (JTextFields and JButtons etc) on J1 are meant to be disabled. For disabling all the controls, we have a function called DisableControls(). This function is called when the button is pressed on J1 to launch J2.
So when J2 is closed using DISPOSE_ON_CLOSE, we want to call another function EnableControls(), so that all the controls are back in enabled state.
My question is - Is there a way to call a function -EnableControls() when the user presses the close button on J2?
Thanks