开发者

How to get the name of global active window using Java?

开发者 https://www.devze.com 2023-01-03 08:38 出处:网络
I am work an Desktop Applicati开发者_如何学Con in which i need to save the name of corrently focused or active window name(mozilla firefox, or any other file name) in an text file currently I am using

I am work an Desktop Applicati开发者_如何学Con in which i need to save the name of corrently focused or active window name(mozilla firefox, or any other file name) in an text file currently I am using getActiveWindow() method of KeyboardFocusManager which give the name of active Window, or null if the active Window is not a member of the calling thread's context.

I want to get the name of Global Active window which corrently user is using.


You're probably out of luck if it has to be cross-platform. The Java VM only knows about the windows it controls. Now, you could likely do it in native code, through JNI, but you'd have to include native binaries for every platform you plan to deploy on.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号