File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes How many monitors do I have? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How many monitors do I have?" Watch "How many monitors do I have?" New topic

How many monitors do I have?

Eitan Levi

Joined: Jun 14, 2006
Posts: 14
I have a question about multiple monitors...

I know that I can use the GraphicsEnvironment class to get a list of screen devices, and from each of those GraphicsDevice objects I can get a plethora of other information.

But if I have more than one monitor, will I necessarily have more than one screen device? Or will I have a single screen device that simply has a huge desktop?

So let's say I have 3 screens each with 1024x768 resolution. When I call getScreenDevices(), will I receive a single entry that has a bounding Rectangle of size 3072x768? Or will I instead get 3 entries, each of which has a bounding rectangle of size 1024x768?

Is the result dependent on different display drivers? What about different operating systems? And if so, how can I tell whether I have one huge desktop panned across 3 monitors, or 3 smaller desktops?

Any help would be greatly appreciated.

Thanks in advance!
[ September 18, 2006: Message edited by: Eitan Levi ]
I agree. Here's the link:
subject: How many monitors do I have?
jQuery in Action, 3rd edition