0

Can you tell if your jframe is behind an OS window, or minimized but requesting focus?

I am writing a multi frame java program and trying to keep track of what new info the user hasn't seen yet in.

Adam Sparks
  • 497
  • 5
  • 12

1 Answers1

2

You can use methods like:

  1. frame.isActive() to determine if the frame currently has focus
  2. frame.getExtendedState() to determine if the frame is minimized

Of course you would to continually poll the frame for this information, so I'm not sure how helpful it will be.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • I noticed if the jframe is created and isn't clicked before it is covered by say an explorer window is active still returns true. But if it is clicked after it is first created it works as expected – Adam Sparks Nov 11 '15 at 08:29