【发布时间】:2011-04-12 02:52:28
【问题描述】:
全部。 我想用 setExtendedState(JFrame.ICONIFIED) 最小化我的 jframe,在大多数情况下,它可以正常工作,但是当我用 WIN+L 锁定我的 os(windows XP) 屏幕时它不起作用。我的 wimple 代码如下:
import javax.swing.JDialog;
import javax.swing.JFrame;
public class FrameTest extends JFrame {
public static FrameTest ft = new FrameTest();
public static void main(String[] args)
{
FrameTest.ft.setVisible(true);
FrameTest.ft.setLocation(300, 300);
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
JDialog dlg = new JDialog( ft, "xxx", true );
ft.setExtendedState(JFrame.ICONIFIED);
dlg.setVisible(true);//if not have this line, it works also in screen lock case
}
}
任何帮助将不胜感激。
【问题讨论】:
-
“开锁”这个词对你来说有什么意义吗?这就是您的代码似乎正在尝试的。
-
系统屏幕自动锁定。我只想知道为什么父框架显示正常但系统屏幕锁定后没有最小化。有什么具体建议吗?