What happens when you minimize JInternalFrame object using built-in icon located in the corner (next to maximizing and closing ones)? I have a JInternalFrame in JDesktopPane and my problem is following: When I minimize one frame it is being minimized. When I try to re-open the frame via using JMenu it works for first time. When I do this procedure again, the frame is being minimized but not re-opened, but when I click manually on a iconified frame, it shows properly. I tried to do combination of setSelected, moveToFront, setIcon, setVisible, activateFrame, or requestFocus, but still no effects. I wonder what happens when you minimize JInternalFrame, what is being set, what should do to get focus of a particular frame, and why the procedure it works for the first time and not others? thanks
Asked
Active
Viewed 793 times
0
-
2could you provide a [sscce](http://sscce.org/) ? – gontard Aug 16 '12 at 14:01
-
There are some example [here](http://stackoverflow.com/q/9414728/230513). – trashgod Aug 16 '12 at 17:19
1 Answers
0
Seems to work fine for me
try {
if (myFrame.isIcon()) {
myFrame.setIcon(false);
miDoShowHide.setText("Hide");
} else {
myFrame.setIcon(true);
miDoShowHide.setText("Show");
}
} catch (Exception exp) {
exp.printStackTrace();
}
I set up a menu item that would call this functionality. I tested by using the menu to min, restore, min, restore. I minimized the frame by the frame control and restored via the menu, minimized by the menu and restored by the frame control.
Also make sure that the JInternalFrame
is set to Iconifiable
(setIconifiable(true)
) otherwise you will experience some strange results

MadProgrammer
- 343,457
- 22
- 230
- 366