【问题标题】:Java full screen exclusive modeJava全屏独占模式
【发布时间】:2012-02-26 21:02:18
【问题描述】:

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

这就是我全屏渲染应用程序的方式:

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);

【问题讨论】:

  • 显示输入对话框的代码是什么?
  • 如需尽快获得更好的帮助,请发帖SSCCE

标签: java swing graphics fullscreen joptionpane


【解决方案1】:
but when I show an input dialog the application is minimized

1) 我无法模拟这个问题,而且如果没有额外的代码iconofied 用于Full-Screen Application 是不可能的

2) 请查看Programming Tips 了解 AWT/Swing

3) setParent(对于JFrame 不可能正确)对于input dialog

4) 检查Top-level ContainersetModal / ModalityTypes 是否不止一个

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多