I have a class extending JFrame which contains group of radioButtons and a submit button. When a user clicks one of them, a new frame opens and the submit button in the previous one is disabled. Now if this new frame is closed, I need that the submit button becomes enabled again. How to do it? Thanks in advance.
I have a class extending JFrame which contains group of radioButtons and a submit
Share
You can have have the parent JFrame implement WindowListener and register it with the child JFrame. When the child JFrame closes it will call the windowClosed() method of the Windowlistener.
As an example look at this.
UPDATE:
Say your new frame is called
JFrame newFrameand the button you want to enable is calledJRButton buttonwhen you build the newFrame you would do something like this, before making the frame visible:This will fire when ever the new frame is closed.