Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

Dual-Display Programming

Thread view: 
akbar@acm.org - 23 Jun 2007 14:11 GMT
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.
Tom Hawtin - 23 Jun 2007 14:24 GMT
> 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
Knute Johnson - 23 Jun 2007 16:19 GMT
> 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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.