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 / April 2006

Tip: Looking for answers? Try searching our database.

different screen resolutions

Thread view: 
steve - 14 Apr 2006 01:51 GMT
Hi,

what is the best way to handle different screen resolutions for  java apps.

I.E
if you have existing code that was written to handle 800*600 , using gridbag
layouts and  frames currently set to (767x556)

obviously at 1024*760 -1280x1024   things are going to be a bit spartan.

any ideas?

Steve

Signature

NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth

James McGill - 14 Apr 2006 02:32 GMT
> any ideas?

Up the steep, rocky path of display scaling lies "AffineTransform."
There's really no device-independent scaling in Java, unfortunately.
steve - 14 Apr 2006 05:04 GMT
>> any ideas?
>
> Up the steep, rocky path of display scaling lies "AffineTransform."
> There's really no device-independent scaling in Java, unfortunately.

sorry my fault.
I was talking about components, such as when a jframe is rescaled by a user,
how to make the other items  internal to the jframe  rescale., fonts to
change  (on buttons, in menus)

as for images (as in rescale , i have that down to a fine art)

steve

Signature

NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth

Tony Morris - 15 Apr 2006 01:41 GMT
>>> any ideas?
>>
[quoted text clipped - 9 lines]
>
> steve

You use a layout manager.
Start here:
http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html
http://javafaq.mine.nu/lookup?290

Signature

Tony Morris
http://tmorris.net/

s/Commonwealth Games/Commonwealth Swimming

Larry Barowski - 14 Apr 2006 13:52 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>
> obviously at 1024*760 -1280x1024   things are going to be a bit spartan.

800x600 is a screen size, 144 dpi is a screen resolution. For a
"normal" application, if you want to scale fonts (mentioned in
Steve's later post in this thread), you should scale them based
on screen resolution (and, possibly, user preference), not
screen size. This way they will (ideally) match fonts in other
applications on the system. Resolution is available through
Toolkit.getDefaultToolkit().getScreenResolution() . The
Windows L&F already scales fonts based on the screen
resolution. For other L&Fs, you would scale by
screen_resolution / 72.0 . I don't think Java has any resolution
information on non-Windows systems though (they will all
appear to be 72 dpi) - I could be wrong here. Search Google
groups for   "change default swing font size"  for information
on scaling all UI fonts in the standard L&Fs.

As far as frame size, if it makes functional sense to resize the
frames, then you could start them out at some fraction of the
screen size. This is available through
Toolkit.getDefaultToolkit().getScreenSize() . On the other hand,
if it makes sense to have fixed-size frames, you should pack()
them to determine the correct size.


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.