* Sets the full-screen mode flag.
*
* @param fullScreen
*/
public static void setFullScreen(boolean fullScreen) {
GraphicsDevice graphicsDevice = windowedHostFrame.getGraphicsConfiguration().getDevice();
if (fullScreen) {
// Go to full screen mode
if (windowedHostFrame.isVisible()) {
windowedHostFrame.remove(primaryDisplayHost);
}
windowedHostFrame.setVisible(false);
graphicsDevice.setFullScreenWindow(fullScreenHostFrame);
fullScreenHostFrame.add(primaryDisplayHost);
fullScreenHostFrame.setTitle(windowedHostFrame.getTitle());
fullScreenHostFrame.setVisible(true);
} else {
// Go to windowed mode
if (fullScreenHostFrame.isVisible()) {
fullScreenHostFrame.remove(primaryDisplayHost);
}
fullScreenHostFrame.setVisible(false);
graphicsDevice.setFullScreenWindow(null);
windowedHostFrame.add(primaryDisplayHost);
windowedHostFrame.setTitle(fullScreenHostFrame.getTitle());
windowedHostFrame.setVisible(true);
}