Multiple Monitor Screens

Does anyone know how to make a Swing application to utilize two monitor screens ? I have a laptop which is hooked up with a monitor via ducking stage. But I do not know why the following code could not recognize the existence of the two monitor screens:

GraphicsEnvironment ge =GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
System.out.println("Number of Monitors: "+gs.length);

Number of Monitors: 1

Jay

How your monitors are configured? Are they mirrored (show the same picture), or is it just one big virtual screen, such that you can drag windows from one screen to another?

We do have support for multiscreen as of 1.3, I believe, and you seem to be using the correct API to work with it. But I don’t think we tested this specific configuration.

What is your OS, video-board, notebook model?
Which jdk version are you using?

Some videoboards with dual-output ports can “fake” the system into thinking that it has only one big screen, so there’s no way for any application to find our that it actually has two physical screens. May be your configuration falls into this category somehow.

trembovetski is probably correct. java doesn’t recognize “non-real” monitors, such as TV-OUT. I did a quick test with

a) one monitor hooked up
b) one monitor + one TV
c) one monitor + two TVs.

java only recognized one monitor, which it should. sorry don’t have another monitor here att the moment so i can’t test more configs.

what is “ducking stage”? are you sure your second monitor qualifies as a monitor (well, you know what i mean)?

Thanks guys. I use a laptop which is Compaq Evo N600C running NT 4.0. The laptop is connected to an external monitor via a ducking station (sorry, not ducking stage). A ducking station is a device which combines all the external connections to a laptop into one. The external monitor is set as primary and the laptop monitor is set as second. I do not know what is video board model. I assume that the two monitors are mirrored.

I’m using jdk1.4 as I understand that starting from jdk1.3 the multiple monitor screens are supported.

is “ducking” a brand of docking?

Aha!
WindowsNT4.0 doesn’t natively support multiscreen, that is, the native windows multiscreen APIs are inexistent on this platform.

Java can do only as good as the underlying platform allows, so as far as Java is concerned, there’s only one screen.

Now, some video board manifacturers do have drivers that sort of implement multiscreen on NT, but all applications will be unaware that there is actually more than one screen, unless they use some private APIs provided by the specific video driver.