forked from External/mage
[UI] Param for starting in fullscreen mode (osx only)
This commit is contained in:
parent
0e2255f71f
commit
eb6dc10faa
2 changed files with 27 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue