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);
I made my application to be full screen in exclusive mode but when I show an input dialog the application is minimized. I want the application to stay full screen and the input dialog to be show over it.
This is how I render my application full screen:
setUndecorated(true);
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
gs.setFullScreenWindow(this);
validate();
Edit:
This is how I open the dialog:
JOptionPane.showMessageDialog(StartingPoint.this,txt, "You are on: " + planet, JOptionPane.INFORMATION_MESSAGE, icon);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
1)我无法模拟这个问题,并且如果没有额外的代码就不可能图标化 为 全屏应用程序
2) 请检查关于 AWT/Swing 的编程技巧
3)
setParent
(不可能直接用于JFrame
)用于输入对话框
4)检查是否有多个顶级容器 与 setModal / ModalityTypes
1) I can't to simulating this issue and simly isn't possible without additional code iconofied for Full-Screen Application
2) please to check Programming Tips about AWT/Swing
3)
setParent
(not possible corectly forJFrame
) forinput dialog
4) to check if isn't there more than one Top-level Container with setModal / ModalityTypes