79446019

Date: 2025-02-17 16:28:48
Score: 3
Natty:
Report link

Apologies that this isn't an answer, but I have the same question and didn't want to duplicate. I tried this:

private void toggleFullScreen() {
    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    
    dispose();
    setUndecorated(true);
    gd.setFullScreenWindow(this);
    setExtendedState(MAXIMIZED_BOTH);
    setVisible(true);
}

The frame appears for a split second and then disappears. Absolutely no idea what I'm doing wrong.

Commenting out setFullScreenWindow and/or setExtendedState results in the same disappearing frame behaviour, just to clarify.

Reasons:
  • Blacklisted phrase (1): I have the same question
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Me too answer (2.5): I have the same question
  • Low reputation (0.5):
Posted by: Willicious