[UI] Param for starting in fullscreen mode (osx only)

This commit is contained in:
magenoxx 2014-08-11 14:39:58 +04:00
parent 0e2255f71f
commit eb6dc10faa
2 changed files with 27 additions and 0 deletions

View file

@ -32,6 +32,25 @@ public class SystemUtil {
}
}
public static void toggleMacOSFullScreenMode(Window window) {
String className = "com.apple.eawt.Application";
String methodName = "getApplication";
String methodName2 = "requestToggleFullScreen";
try {
Class<?> clazz = Class.forName(className);
Method method = clazz.getMethod(methodName);
Object appInstance = method.invoke(clazz);
Class params[] = new Class[]{Window.class};
method = clazz.getMethod(methodName2, params);
method.invoke(appInstance, window);
} catch (Throwable t) {
System.err.println("Full screen mode is not supported");
t.printStackTrace();
}
}
public static void main(String... args) {
System.out.println(isMacOSX());
}