java - Checking if window has keyboard focus again -


preface

i'm designing application @ 1 stage have it's keyboard focus taken away , redirected application. application in question google-chrome. @ stage program should pause, or halt it's operations entirely until keyboard focus has been returned.

some information:

  • my application being written in java
  • the application granted keyboard focus google-chrome

what need

a way test if jframe has keyboard focus maybe like:

jframe.hasscreenfocus() 

or effect.

you should able use windowlistener , listen windowactivated() event. need listen windowdeactivated() stop current processing.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -