3

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

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

Rekin
  • 9,731
  • 2
  • 24
  • 38