我试图把我的窗口集中在(使用jnativehook)一个按键,但得到这个错误: java.lang.IllegalStateException: This operation is permitted on the event thread only; currentThread = JNativeHook Dispatch Thread` exception.
好像我不能改变来自钩子线程的U
所以我试图“登录”被按下的键。问题是当我运行我的代码时,程序会自动停止并将我发回到我可以编码的地方。 我使用Eclipse
import org.jnativehook.keyboard.NativeKeyEvent;
import org.jnativehook.keyboard.NativeKeyListener;
public class Listener