Java Utililty Methods Full Screen

List of utility methods to do Full Screen

Description

The list of methods to do Full Screen are organized into topic(s).

Method

voidenableFullScreenMode(Window window)
enable Full Screen Mode
String className = "com.apple.eawt.FullScreenUtilities";
String methodName = "setWindowCanFullScreen";
try {
    Class<?> clazz = Class.forName(className);
    Method method = clazz.getMethod(methodName, new Class<?>[] { Window.class, boolean.class });
    method.invoke(null, window, true);
} catch (Throwable t) {
    System.err.println("Full screen mode is not supported");
...
voidenableOSXFullscreen(Window window)
enable OSX Fullscreen
if (null == window)
    return;
try {
    Class util = Class.forName("com.apple.eawt.FullScreenUtilities");
    Class params[] = new Class[] { Window.class, Boolean.TYPE };
    Method method = util.getMethod("setWindowCanFullScreen", params);
    method.invoke(util, window, true);
} catch (ClassNotFoundException e1) {
...
voidmakeFullscreen(Frame frame, boolean attemptExclusiveMode)
Exclusive mode is only available if isFullScreenSupported returns true.
maximize(frame);
frame.setUndecorated(true);
frame.setLocation(0, 0);
frame.setResizable(false);
if (attemptExclusiveMode) {
    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    gd.setFullScreenWindow(frame);
booleansetFullScreen(Window toplevel, boolean fullscreen)
Makes a window full screen (method 1).
GraphicsDevice device;
device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if (USE_TRUE_FULL_SCREEN && device.isFullScreenSupported()) {
    boolean currentlyfullscreen = device.getFullScreenWindow() == toplevel;
    if (fullscreen != currentlyfullscreen)
        device.setFullScreenWindow(toplevel);
    return true;
return false;