isFullScreenSupported always true for monitors

南笙酒味 提交于 2019-12-10 21:43:18

问题


Given the following code

 GraphicsDevice screen = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0];
 if (screen.isFullScreenSupported()) {
      //is it always true for monitors?
 }

Is screen.isFullScreenSupported() always true for monitors?


回答1:


No, it may not be true.

The SecurityManager might disallow you the full screen control. Mainly because one could easily fake whole screen in order to grab a password from not-suspecting user (you could mock a bank website).

It can be false:

  • in an applet
  • in a WebStart Application
  • while running in headless mode

JavaDOC of GraphicsDevice.isFullScreenSupported:

Returns true if this GraphicsDevice supports full-screen exclusive mode. If a SecurityManager is installed, its checkPermission method will be called with AWTPermission("fullScreenExclusive"). isFullScreenSupported returns true only if that permission is granted



来源:https://stackoverflow.com/questions/13351936/isfullscreensupported-always-true-for-monitors

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!