Link to home
Start Free TrialLog in
Avatar of lawpan
lawpan

asked on

How to known if OS is running more than 1 monitor.

I have two monitors. I am running an application in the second monitor and saves cordinates in a file. When I move the application to another computer that only have 1 monitor the window is not visible due to location outside the monitor.


Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

gets me 1600x1200
But my windows is located lets say 1680x150 and not visible.
I could remove 1600 from the 1680 automatically. But I want to support more monitors.

There is a method
Toolkit.getDefaultToolkit().getDesktopProperty(StringPopertyName);

Does anyone know what property I should look for?
Or some way to ask the OS number of monitors etc.
Avatar of dnoelpp
dnoelpp
Flag of Switzerland image

Please have a look at:

http://java.sun.com/j2se/1.3/docs/guide/awt/enhancements.html

They tell you how to support more than one monitor.

I will look for a solution working in Swing. Stay tuned.
ASKER CERTIFIED SOLUTION
Avatar of dnoelpp
dnoelpp
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops, a typo! Should be GraphicsEnvironment instead of GraphiceEnvironment.

Sorry!
Avatar of lawpan
lawpan

ASKER

Thank you very much. This was what I was looking for.
Avatar of lawpan

ASKER

Thank you very much. This was what I was looking for.