We are developing an application using Java Swing and most of the cases, this application will be accessed using JNLP links and Citrix Presentation Servers and
all the users will have multiple screens connected to their computers.
My problem is, I have to show some warning pop-up windows, alert pop-up windows etc at the center of the application. In case if the application is mostly hidden (like only the left edge of the application is visible and the rest is not shown on any screen), I have to show the pop-up on the relevant screen where the user can actually see it.
How can I detect on which screen/monitor my application is located? Ex. The application is located on screen number 4 and it is only partly visible. In this case, I have to show the pop-up at the center of screen 4. If the application is completely visible on screen 3, I have to show the pop-up at the center of the application window.
I have been trying to figure this out for a long time but not able to... .
Thanks in advance for the perfect answer....
Reach for the sky.. even if you have to stand on cactus!
The thing you have to ask yourself is this though: what if a window is positioned in two screens? On which one do you display it? The first you encounter, or the one that contains the largest part of the window?
Thanks Rob for the reply. I will try it rightaway.
And when the application window is positioned over two screens, I will still be showing the pop-up at the center of the application (even if the pop-up will be split over the two screens). I hope I will not have any problems showing it that way.. let me check. Thank you for the new test case ...
Anand Kumar Reddy
Joined: Jul 01, 2008
In addition to my initial question, I have one more question. If the application is being accessed via Citrix Presentation servers, will the call to :
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment() return the Graphics environment of the client machine or the citrix server?