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
Post a Comment