I have a java swing program consisting of many jframes, i know not the best design, but it does the job.
If i open another program, for example firefox, and maximize that window, my jframes are not visible.
Now when i click the button on the window taskbar of one of my jframes the jframe popups up.
When this jframe popups up i need check if one of my other jframes are visible, i mean are in front of firefox window.
I tried isVisible(), isShowing() and isDisplayable() but they always return true even when the jframe is below the firefox window. That makes sense when reading the javadoc.
But i can't seem to find a method to tells me if my jframe is really visible in front of the firefox window.
It puzzles me.
[edit] A jframe covered by firefox has the following properties:
14:50:08,129 DEBUG DrawFrame - isVisible: true
14:50:08,129 DEBUG DrawFrame - isDisplayable: true
14:50:08,129 DEBUG DrawFrame - isShowing: true
[edit2]
Just to explain my goal: i have multiple jframes and when i click one specific jframe button on the window taskbar i want to check if another jframe is visible for the user. If it is not visible for the user (for example when covered by another program) than i want to make it visible. Making it visible is simple: WindowListener windowActivated and call toFront on the not visible frame, but of course this causes a loop when the other jframe is activated again ( calling windowActivated > toFront > windowActivated > toFront, and so on :-) ) That is why i need to check the visibility before calling the toFront method.
[edit3]
There doesn't seem to be a function in java to check if a window is visible for the user, so going native is the only solution, a topic on stackoverflow gave me the answer: Windows: how to get a list of all visible windows?
Cheers!