JDialog Not Displaying When in Fullscreen Mode

前端 未结 4 1234
刺人心
刺人心 2021-01-15 14:40

I have an application that runs in fullscreen mode and has been working fine. Now I need to add a simple, undecorated dialog and I\'m running into trouble. If I run the ap

相关标签:
4条回答
  • 2021-01-15 15:11

    JOptionPane.showInternalXXXDialog() methods render dialogs as JInternalFrames. Maybe you could consider using a JIternaFrame to simulate the dialog box.

    0 讨论(0)
  • 2021-01-15 15:16

    And in fact, as M1EK alluded in his answer and I mentioned in a comment, Java applications in full screen mode will not allow other windows to show over them. The Javadoc API for GraphicsDevice reads:

    Windows cannot overlap the full-screen window. All other application windows will always appear beneath the full-screen window in the Z-order.

    In the end, I reconfigured my application so that it doesn't enter full screen mode until a bit later. This still gives me a fairly class presentation at the start and allows my JDialog to function as it should. The transition to full screen mode is quick and smooth, even in the "middle" of my app.

    0 讨论(0)
  • 2021-01-15 15:23

    Do you really want to be in full-screen mode for this app? That's more of a gaming feature - to get more direct access to the frame-buffer, I always thought. Have you read this tutorial:

    http://java.sun.com/docs/books/tutorial/extra/fullscreen/index.html

    Really seems to me not to be the best choice for a Swing app with child windows.

    0 讨论(0)
  • 2021-01-15 15:25

    Try to us this. Is not an exclusive full screen but it is close enough.

    setExtendedState(JFrame.MAXIMIZED_BOTH);
    setUndecorated(true);
    
    0 讨论(0)
提交回复
热议问题