给定以下代码
GraphicsDevice screen = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()[0];
if (screen.isFullScreenSupported()) {
//is it always true for monitors?
}
对于显示器,screen.isFullScreenSupported()
是否始终为真?
最佳答案
不,这可能不是真的。
SecurityManager 可能不允许您进行全屏控制。主要是因为可以很容易地伪造整个屏幕,以便从不怀疑的用户那里获取密码(您可以模拟银行网站)。
可以是假的:
- 在小程序中
- 在 WebStart 应用程序中
- 在 headless 模式下运行时
JavaDOC 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
关于java - isFullScreenSupported 对于监视器始终为真,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13351936/