I have a dual-display setup with Windows XP (Service Pack 2). I am
looking for a way to control both displays independently, so that I
can draw different graphics and display different text on both
monitors. Is there a way to do that in Java?
Thanks,
Akbar.
> I have a dual-display setup with Windows XP (Service Pack 2). I am
> looking for a way to control both displays independently, so that I
> can draw different graphics and display different text on both
> monitors. Is there a way to do that in Java?
You want java.awt.GraphicsEnvironment.
Call the static method getLocalGraphicEnvironment to get an instance
reflecting your machine. getScreenDevices should then give each display.
I've barely used it at all, so don't know the traps and pitfalls. I
don't know how it handles xinerama or xrandr on non-Windows machines,
for instance.
Tom Hawtin
> I have a dual-display setup with Windows XP (Service Pack 2). I am
> looking for a way to control both displays independently, so that I
[quoted text clipped - 3 lines]
> Thanks,
> Akbar.
See the GraphicsEnvironment class as Tom said and the GraphicsDevice and
GraphicsConfiguration classes. I assume that the other monitor will
have your Windows desktop on it. In that case you can reference the
other monitor as though it were part of one large monitor. Depending on
what you are doing that might be simpler. The GraphicsConfiguration
class will allow you to place your windows and frames on a specific
monitor. If you provide a few more details about what you are actually
doing then I can give you more information.

Signature
Knute Johnson
email s/nospam/knute/
akbar@acm.org - 24 Jun 2007 05:29 GMT
On Jun 23, 8:19 pm, Knute Johnson <nos...@rabbitbrush.frazmtn.com>
wrote:
> a...@acm.org wrote:
> > I have a dual-display setup with Windows XP (Service Pack 2). I am
[quoted text clipped - 18 lines]
> Knute Johnson
> email s/nospam/knute/
Thanks Tom & Knute for your replies. I was successfully able to
display 2 different JFrames on 2 different displays.
Knute, I have my windows desktop extended to other monitor as
secondary device. Actually, I am using a single embedded PC board with
2 touch screen displays in a fuel dispenser. The 2 displays will be on
the 2 opposite sides of the dispenser. Both the displays need to work
independently, since the filling is independent on both sides. So I
need to display different status on both sides of the screen. I am
planning to invoke a Jframe on both sides, and then manipulate that
JFrame separately for each filler.