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
问问题
769 次
1 回答
0
对我来说似乎工作得很好
try {
if (myFrame.isIcon()) {
myFrame.setIcon(false);
miDoShowHide.setText("Hide");
} else {
myFrame.setIcon(true);
miDoShowHide.setText("Show");
}
} catch (Exception exp) {
exp.printStackTrace();
}
我设置了一个可以调用此功能的菜单项。我通过使用菜单来测试 min, restore, min, restore。我通过框架控件最小化框架并通过菜单恢复,通过菜单最小化并通过框架控件恢复。
还要确保JInternalFrame
设置为Iconifiable
( setIconifiable(true)
) 否则你会遇到一些奇怪的结果
于 2012-08-16T20:28:22.127 回答