2012-02-04 104 views
2

我使我的应用程序成为全屏独占模式,但是当我显示输入对话框时,应用程序被最小化。我希望应用程序保持全屏显示,并在其上显示输入对话框。Java全屏独占模式

这是我如何使我的应用程序全屏:

setUndecorated(true); 
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); 
GraphicsDevice gs = ge.getDefaultScreenDevice(); 
gs.setFullScreenWindow(this); 
validate(); 

编辑:

我这是怎么打开的对话框:

JOptionPane.showMessageDialog(StartingPoint.this,txt, "You are on: " + planet, JOptionPane.INFORMATION_MESSAGE, icon); 
+1

什么是您的代码显示输入对话框? – 2012-02-04 17:01:15

+0

我编辑了问题 – Alex 2012-02-04 18:27:51

+0

为了更好地帮助,请发布[SSCCE](http://sscce.org/)。 – 2012-02-05 01:18:23

回答