0

简而言之,我正在开发一个应用程序,我尝试在java.policy文件中手动设置权限,但没有任何效果。它每次都会产生相同的异常..

java.lang.SecurityException: this KeyboardFocusManager is not installed in the current thread's context
    at java.awt.KeyboardFocusManager.getGlobalFocusedWindow(KeyboardFocusManager.java:733)
    at javaapplication1.Temp.go(Temp.java:26)
    at javaapplication1.Temp.main(Temp.java:35) 

无论如何,我可以通过编程或手动添加这一行,权限 java.awt.AWTPermission "replaceKeyboardFocusManager";

进入java.Policy,我需要让这个东西工作,我有什么遗漏吗?

4

0 回答 0