1

I have a custom Java Swing application that displays its content in two separate and independent JFrames. How can I determine if one of my frames - or any displayable Java component in gereneral - is actually really visible on screen? I am speaking of "real visibility" in the meaning that I can actually see it.

Example: my application has been made visible using setVisible(true), but when I move any other window or application in front of my application, it gets hidden behind that new window and I am no longer able to see it.

I have used: frame.isVisible(), frame.isShowing() and frame.isDisplayable().

All three evaluate to true no matter if my JFrame is actually visible on top of the screen, minimized in the task bar or hidden behind any other window.

Bate
  • 61
  • 8
  • This would require an operating system API since non-Java windows could obscure your frame. Search on `java windows z-order` and you'll see that it's generally not possible even _within_ a single Java GUI app. – Jim Garrison Feb 20 '21 at 20:19
  • 1
    Any extra information, or alternative approaches to the problem you see here, should be integrated into the original question. This is now closed as a duplicate of that one. – Andrew Thompson Feb 20 '21 at 20:53
  • Please note the original duplicate target was deleted, and was just minutes ago edited by a moderator to point to another non-deleted target. – TylerH Feb 20 '23 at 21:38

0 Answers0