java setFullScreenWindow在Mac中隐藏登录对话框 [英] java setFullScreenWindow hides log in dialog in Mac

查看:99
本文介绍了java setFullScreenWindow在Mac中隐藏登录对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用全屏窗口来类似于屏幕保护程序.在这里使用方法

I was using a full screen window to something similar to screensaver. Using the method here,

GraphicsEnvironment.getLocalGraphicsEnvironment()
                  .getDefaultScreenDevice()
                  .setFullScreenWindow(this);

但是,当屏幕锁定或运行屏幕保护程序并显示此屏幕时,该屏幕将显示在顶部.我无法访问登录提示.因此,java框架位于最上方,我什么也无法做.我必须重新启动计算机才能摆脱这种情况.

But when the screen is locked, or the screensaver runs, and this screen is shown, this screen is shown on top. I can't get access to the login prompt. So the java frame is on top and I can do nothing. I have to restart the computer to get rid of this.

自从出现登录屏幕后,没有其他窗口获得鼠标/键盘输入.通过按ESC或鼠标移动事件退出我的窗口.

Since when the login screen comes, no other window gets mouse/keyboard input. My window exit by pressing ESC or mouse movement events.

如何掌握整个屏幕,但是如果出现登录对话框,应该将其显示在顶部?

How can I get hold of the whole screen, but if the login dialog appears, it should be shown on top?

推荐答案

恐怕这里没有清晰,纯净的Java解决方案. 我建议您在打开此全屏窗口之前检查屏幕保护程序是否正在运行.因此,问题是如何检测屏幕保护程序是否正在运行?欢迎您进行自我搜索,但我的快速调查表明您需要特定于平台的代码.

I am afraid that clear, pure java solution does not exist here. I'd suggest you to check whether the screen saver is running before opening this full screen window. So the question is how to detect whether screen saver is running? You are welcome to search yourself but my fast investigation showed that you need platform specific code.

以下链接显示了两种Windows解决方案:如何确定屏幕保护程序是否正在Java中运行?

The following link shows 2 solutions for windows: How to determine if a screensaver is running in Java?

在MAC的情况下,第二种解决方案可能会为您提供帮助.检查您是否可以识别屏幕保护程序的过程.如果您仅可以获取正在运行的进程的列表(通过执行外部命令行)并验证该进程正在运行.

Probably the second solution can help you in case of MAC. Check whether you can identify the process of screen saver. If you can just get list of running processes (by execution external command line) and verify that such process is running.

这篇关于java setFullScreenWindow在Mac中隐藏登录对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆