I have been using a JButton in Netbeans to open a child JFrame in Java.
I want the original parent frame not to dispose but to be disabled behind the child frame. So the code for the button action (to open the child frame) performed is:
this.setEnabled(false);
new Child().setVisible(true);
OK then everything is fine. I mean the child frame opens, but the problem is when I try to close it. I want the child frame to be invisible (not disabled) but the original parent frame to be enabled again. I have already set the default close operation to DO_NOTHING_ON_CLOSE, and I tried to use this:
this.dispose();
Parent.setEnabled(true);
However, this apparently does not work. I have read that I need to do some operations in the main class or I should use a dialog instead of another child frame but I am not familiar with them. Could you please suggest which solution would be more efficient for my work in Netbeans and also give some guidelines?