The Code
private MainApp() /* Extends JFrame */{
DisplayMode displayMode = new DisplayMode(800, 600, 16, 75);
ScreenManager.setFullScreenWindow(displayMode, this);
}
The Problem
Whenever I call:
JOptionPane.showMessageDialog(MainApp.getInstance(), "Test Message Box");
The Window minimizes for some reason, then I have to re-activate it. The Message Box shows after I re-activate the Window.
The Question
Is there any way to stop the Fullscreen Window from minimizing when I call the Message Box?
Whenever a modal dialog is displayed (JOptionPane, JFileChooser, etc.), the JFrame gets a WINDOW_DEACTIVATED WindowEvent. Simply ignore the window deactivation when your app is displayed as fullscreen:
Be sure to set the parent of modal dialog correctly:
Where "this" is your top most JPanel, JInternalFrame, or JFrame.