If I have two JFrames where one is the main JFrame, and the other one pops up when I click something. Now what I want is that when the new frame pops up, the main one should be minimized. Also when I click on this popup frame to close it, the main should be restored back.
Essentially I want to know, how can we maximize and minimize a JFrame apart from the default click operation. Is there any function for doing this on custom click for example?
1) setDefaultCloseOperation to NOTHING_ON_CLOSE
2) addWindowListener to
JFrame3) overrive
windowsClosing()method with properActionfor iconify …4) don’t forget to set to the JMenuItem/JButton
System.exit(1), because in this form current JVM instence never gone from PC RAM or swap area until PC restarted or switch off5) better would be to change 2nd.
JFrameto the JDialog because in most cases is too hard manage lots of methods betweens twoJFramessetPatentsetModalsetModalityTypes