1.4.2 Changing Plaf and Toolbar - possible bug?

F

Frank D. Greco

I have a small 1.4.2 Swing app that has a JToolbar. The JToolbar
uses small images.

If I change the plaf on my app from Java to Java, the images
are drawn each with an border. And the border is larger than the
image, so the JToolbar gets longer than it should.

Any other plaf has the same (unexpected) border. GTK and Motif are
least offensive in terms of resizing the images, but the Java (metal),
Kunststoff and Windows plafs all increase the whitespace around the
image and put borders around each image.

Anyone see this behavior?

Frank
+=========================================+
| Crossroads Technologies Inc. |
| Enterprise Java Engineering |
| Web: www.CrossroadsTech dot com |
| Email: fgreco @ cross roads tech dot com|
+=========================================+
 
K

Karsten Lentzsch

Frank said:
I have a small 1.4.2 Swing app [...]

If I change the plaf on my app from Java to Java,
the images are drawn each with an border. [...]

There's a bug in some l&fs with setting and
changing the toolbar button rollover border.
Some l&fs do not mark the new border with
the UIResource interface and so, these borders
won't change if the l&f changes.

This affects the button border and in turn
the button insets.

If you search for a bug or report a bug to Sun
you should provide the exact Java version
you are using and the sequence of l&fs you
set in the toolbar, for example:
Java l&f, Sun Windows l&f in XP mode, ...

The JGoodies Looks Demo indicates if a l&f
uses rollover borders marked as UIResource;
if not, the tool shows a warning icon and tells
you that the l&f can swap borders properly, see
the upper right corner in the following image:
http://www.jgoodies.com/freeware/looksdemo/images/looksdemo.png
Here's the demo:
http://www.jgoodies.com/freeware/looksdemo/

Regards,
Karsten Lentzsch
 
D

Dave Glasser

Frank said:
I have a small 1.4.2 Swing app [...]

If I change the plaf on my app from Java to Java,
the images are drawn each with an border. [...]

There's a bug in some l&fs with setting and
changing the toolbar button rollover border.
Some l&fs do not mark the new border with
the UIResource interface and so, these borders
won't change if the l&f changes.

My app, QueryForm, (http://qform.sourceforge.net) allows the L&F to be
changed on-the-fly at runtime. A lot of the L&F's out there seem to
neglect using the UIResource interface for their various borders,
fonts, colors, etc., so when you switch away from them to another L&F,
a lot of stuff doesn't get changed that should. I tried your JGoodies
freeware L&Fs, however, and I have to say that, aside from looking
very good, they're among the best-behaved ones I tested with. My
compliments.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,045
Latest member
DRCM

Latest Threads

Top