How do I make my JWindow window always stay focused
问题 I am making a java application that includes a JWindow. I want to be able to track the mouse without the user having to click the window after going to another window. 回答1: Your question is little vague on why you want to continue processing the mouse once it's left the JWindow ...but You have two (basic) choices when it comes to mointoring the mouse outside of your application, you can use a JNI/JNA solution or you can poll MouseInfo. The following demonstrates the latter, using MouseInfo