How can I do full screen in Java on OSX

前端 未结 3 1712
逝去的感伤
逝去的感伤 2020-12-14 23:12

I\'ve been trying and failing to use the java full screen mode on the primary display of an OSX system. Whatever I\'ve tried I can\'t seem to get rid of the \'apple\' menu

3条回答
  •  清歌不尽
    2020-12-14 23:23

    On OS X (10.7 and higher), it is better to use the native fullscreen mode available. You should use:

    com.apple.eawt.FullScreenUtilities.setWindowCanFullScreen(window,true);
    com.apple.eawt.Application.getApplication().requestToggleFullScreen(window);
    

    where window is the window (JFrame, etc) that you want to take fullscreen

提交回复
热议问题