Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有简单的java应用程序
main(){ Robot robot = new Robot(); Thread.sleep(5000); }
当我在 macosx 上运行它时,它会从我的其他 java 应用程序中获取焦点。我可以阻止它吗?也可以粘贴 Toolkit.getDefaultTookit 而不是 Robot 具有相同的效果。
java -Dapple.awt.UIElement=true您应该通过“ ”或通过设置属性 apple.awt.UIElement 等于 trueSystem.setProperty()
java -Dapple.awt.UIElement=true
System.setProperty()