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 / August 2007

Tip: Looking for answers? Try searching our database.

Swing application getting affected by screen resolution

Thread view: 
Chanchal - 27 Jul 2007 11:22 GMT
Hello All,

       Kindly give me some input on how to make sure that Swing
applications adjusts the placememnt of screen elements as the monitor
resoulution changes,  so that the UI will not become obscure.

Thanks in advance

Chanchal
Roedy Green - 27 Jul 2007 11:53 GMT
>Kindly give me some input on how to make sure that Swing
>applications adjusts the placememnt of screen elements as the monitor
>resoulution changes,  so that the UI will not become obscure.
see http://mindprod.com/jgloss/resolution.html
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Knute Johnson - 27 Jul 2007 18:32 GMT
> Hello All,
>
[quoted text clipped - 5 lines]
>
> Chanchal

The short answer is you can't.  The long answer is more complicated.  If
you are running XP you can change the DPI setting to help but it isn't
going to fix it all.  You can try scaling your components or using some
third party libraries but it will be unending grief.  The sad fact is
that by the time the monitor resolution gets to 1600x1200 or larger the
frames and controls will be unusably small.

Signature

Knute Johnson
email s/nospam/knute/

Roedy Green - 28 Jul 2007 08:35 GMT
>The sad fact is
>that by the time the monitor resolution gets to 1600x1200 or larger the
>frames and controls will be unusably small.
I have submitted an RFE for self-adjusting apps.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

Larry Barowski - 28 Jul 2007 17:59 GMT
> The sad fact is that by the time the monitor resolution gets to 1600x1200
> or larger the frames and controls will be unusably small.

Font sizes will adjust to the system DPI for theWindows L&Fs and the
Mac L&F under Swing (on their corresponding systems, of course). It's
easy enough to make your application's fonts adjust to the system DPI for
other Swing L&Fs in a global way (and also provide user-adjustable global
font scaling to help out users on systems where the DPI is unadjustable
and inappropriate). Fixed sized margins and borders don't normally hurt
usability for the range of monitor resolutions in common use, and can be
scaled where necessary. Some icons can be self-drawn and auto-scaling,
while others can be chosen from multiple-sized sets, though this is not
frequently done.

I operate at 1600x1200 on a 20 inch screen and dpi set to 144, and most
Java apps that I use are fine, or at least scale appropriately under Windows
L&F. I expect that 3200x2400 and 288 dpi on the same screen would
result in some issues with tiny icons, tight margins, and nearly invisible
borders for most Java applications. If monitors with that kind of resolution
become common, many Java applications will need some reworking to
make them usable.
Chanchal - 31 Aug 2007 05:34 GMT
thank you all verymuch for the valuable suggestions. i'll try these
options.
Chanchal
Karsten Lentzsch - 31 Aug 2007 09:44 GMT
> [...]
> Font sizes will adjust to the system DPI for theWindows L&Fs and the
> Mac L&F under Swing (on their corresponding systems, of course).

The Sun Windows L&f uses the default GUI font that scales
with the software resolution, but doesn't honor the desktop
setting for normal/large/extra large fonts.

I provide a Windows L&f that uses the icon font by default
that honors the software resolution as well as the desktop
font size setting (normal/large/extra large). More precisely
the JGoodies L&fs include a FontPolicy mechanism that is used
to specify which font shall be used for a given platform, L&fs,
and platform settings.

> [...] Fixed sized margins and borders don't normally hurt
> usability for the range of monitor resolutions in common use, and can be
> scaled where necessary. [...]

The range of monitors in teams I work with is about 78 dpi (hardware)
up to 144 hardware dpi. This leads to significantly sizes on the
higher dpi hardware. This affects borders, gaps, table column widths,
custom preferred sizes for trees and lists.

Therefore I use Dialog Units (DLU) for these sizes where possible.

-Karsten Lentzsch
Larry Barowski - 31 Aug 2007 15:53 GMT
>> [...] Fixed sized margins and borders don't normally hurt
>> usability for the range of monitor resolutions in common use, and can be
[quoted text clipped - 6 lines]
>
> Therefore I use Dialog Units (DLU) for these sizes where possible.

For table column widths and preferred sizes for trees and lists, I
always base the size on the font currently used in the table, tree,
or list (assuming these items contain mostly text).

It's a good idea to use a global base value for margins and
possibly borders that can be keyed to the DPI or font size by
default, but is also adjustable by the user, separately from the
global font scale I mentioned before. If the user wants giant
fonts and tiny margins, they should be able to have them.


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.