屏幕保护程序打开时全屏 Java 应用程序最小化
我有一个应用程序可以设置全屏框架,但在屏幕保护程序打开时似乎会最小化。我希望这个应用程序成为触摸屏信息亭用户可以使用的唯一应用程序,所以这是一个问题。有什么办法可以防止这种情况发生吗?
I have an app that sets a fullscreen frame but seems to minimize when the screensaver turns on. I want this app to be the only application that the users of the touchscreen kiosks can use so this is a problem. Is there anyway to prevent this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
互联网说实现这一点的跨平台方法是使用以下代码安排键盘事件:
并安排它每几分钟运行一次(例如使用
thread.sleep();
)。这样屏幕保护程序就不会出现。不过,我不知道有什么非黑客的、跨平台的解决方案,我很高兴看到了解它的人提供一个解决方案:)
The internet says that the cross-platform way to achieve this is to schedule keyboard events with this code:
and to schedule it to run every couple of minutes (e.g. with
thread.sleep();
). This way the screen-saver will not show up.I have no idea, though, about a non-hackish, cross-platform solution, and I would be very happy to see one from someone who knows it :)
另一种方法是添加窗口侦听器并在其停用时重置状态:
但禁用屏幕保护程序可能是最好的开始。
Another way is to add a window listener and reset state when it's deactivated:
But disabling screensaver might be the best thing to start with.
可能(还没有尝试过!)您可以通过结合这些问题的答案来得到答案:
从Java调用Win32 API方法
需要禁用屏幕保护程序/屏幕锁定Windows C#/.Net
当然,这仅适用于 Windows,这就是我向您询问操作系统的原因:)
Probably (haven't tried it !) you'll get your answer by combining the answers to these questions:
Calling Win32 API method from Java
Need to disable the screen saver / screen locking in Windows C#/.Net
Of course this works only in Windows that's why I asked you about your OS :)