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 / GUI / March 2004

Tip: Looking for answers? Try searching our database.

Dual Monitor and Swing JFrame

Thread view: 
California Paladin - 17 Mar 2004 20:45 GMT
I have created an applet that launches a JFrame with JPanel.
Everything works fine when only using a single monitor. I use pack()
to set the JFrame size.

The problem is that when dual monitors are used.  If the second
monitor is of higher resolution than the first, then my JFrame will
create itself with the dimensions of the second monitor, eventhough it
is display on the first.  Is there some way in a dual monitor system
to determine which monitor the app is displaying on, and then get that
monitor's resolution?

Thanks for you help.

California Paladin
Jonathan Fuerth - 17 Mar 2004 23:54 GMT
> I have created an applet that launches a JFrame with JPanel.
> Everything works fine when only using a single monitor. I use pack()
[quoted text clipped - 3 lines]
> monitor is of higher resolution than the first, then my JFrame will
> create itself with the dimensions of the second monitor, eventhough it

Why does your pack() operation depend on the screen size at all?  Have
you set the preferred size of the content pane to the screen size?

> is display on the first.  Is there some way in a dual monitor system
> to determine which monitor the app is displaying on, and then get that
> monitor's resolution?

I'm not sure.  There might be a way to enumerate the physical displays
that make up a multi-screen virtual desktop in the new full-screen
exclusive API, but I don't know much about that except to say it's
definitely not supported on all platforms.

-Jonathan
Thomas Weidenfeller - 18 Mar 2004 08:56 GMT
> Is there some way in a dual monitor system
> to determine which monitor the app is displaying on, and then get that
> monitor's resolution?

Look up java.awt.GraphicsEnvironment, and work your way through the API
documentation.

/Thomas


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.