*/
public static void setFullScreen(boolean fullScreen) {
if (fullScreen != isFullScreen()) {
DisplayHost displayHost = applicationContext.getDisplayHost();
GraphicsDevice graphicsDevice =
windowedHostFrame.getGraphicsConfiguration().getDevice();
if (fullScreen) {
// Go to full screen mode
windowedHostFrame.remove(displayHost);
windowedHostFrame.setVisible(false);
fullScreenHostFrame.add(displayHost);
fullScreenHostFrame.setVisible(true);
graphicsDevice.setFullScreenWindow(fullScreenHostFrame);
} else {
// Go to windowed mode
try {
graphicsDevice.setFullScreenWindow(null);
} catch (Exception exception) {
// TODO remove this catch. On Win32 platforms, the
// preceding call can throw.
}