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 / December 2003

Tip: Looking for answers? Try searching our database.

JRadioButton positioning in JRE 1.4

Thread view: 
Roger Levy - 15 Dec 2003 20:41 GMT
I've long been maintaining an application that positions many JRadioButtons
inside JFrames having GridLayouts.  For an application built with SDK 1.3, the
positioning of the buttons has always been consistent with JRE 1.2 and 1.3.
However I've found that the same application executed under JRE 1.4 results in
the buttons being positioned more to the right in the JFrame.  The problem is
that the allocation of space is such that right side labels, which are always
1-3 digits, no longer fit when the label is 3 digits.  There are good reasons
why I don't want to stretch my graphics horizontally so is there something I can
do to get the same Look 'n Feel from JRE 1.4 that JRE 1.2 and 1.3 gave me?

Roger
Signature

Change "3e" in my address to "eee"

Karsten Lentzsch - 15 Dec 2003 21:11 GMT
> [...] so is there something I can do to get the same
> Look 'n Feel from JRE 1.4 that JRE 1.2 and 1.3 gave me?

You can override the default borders for all instances
of JRadioButton and JCheckBox. Or you can use a l&f
that does this automatically to ensure a consistent
appearance over the different platforms.

The open source Plastic l&f family and the JGoodies
Windows l&f remove the borders as described above.

The project is located at http://looks.dev.java.net/

Hope this helps,
Karsten
Roger Levy - 16 Dec 2003 13:12 GMT
I can think of three parameters that constitute what you call "borders."  They
are the insets of the JRadioButton, the insets of the frame, and the horizontal
and vertical gaps in the GridLayout that positions the button in the frame.
Since the application sets these parameters (they are 4's, 2's, and 0's
respectively) and since those values don't change whether the application is
being executed by JRE 1.3 or 1.4, what exactly do you think I should override?
If the JRE is taking these parameters and rendering things differently then I
don't understand what I should override or how the custom L & F packages you
mentioned will help.

Roger

> > [...] so is there something I can do to get the same
>  > Look 'n Feel from JRE 1.4 that JRE 1.2 and 1.3 gave me?
[quoted text clipped - 11 lines]
> Hope this helps,
> Karsten

Signature

Change "3e" in my address to "eee"



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



©2009 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.