Java Full Screen enableOSXFullscreen(Window window)

Here you can find the source of enableOSXFullscreen(Window window)

Description

enable OSX Fullscreen

License

Apache License

Parameter

Parameter Description
window a parameter

Declaration

@SuppressWarnings({ "unchecked", "rawtypes" })
public static void enableOSXFullscreen(Window window) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Window;
import java.lang.reflect.Method;

public class Main {
    /**//ww w.  j  a va2s . c  o m
    * @param window
    */
    @SuppressWarnings({ "unchecked", "rawtypes" })
    public static void enableOSXFullscreen(Window window) {
        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) {
        } catch (Exception e) {

        }
    }
}

Related

  1. enableFullScreenMode(Window window)
  2. makeFullscreen(Frame frame, boolean attemptExclusiveMode)
  3. setFullScreen(Window toplevel, boolean fullscreen)