Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4908404
Votes 0
Synopsis Backward compatability problems with Ocean
Category java:classes_swing
Reported Against 1.5 , tiger , tiger-beta
Release Fixed 1.5(tiger-b32)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 4913321 , 4949032 , 4965399
Submit Date 18-AUG-2003
Description
It appears that JButtons with a customized background color are not rendered
properly with the Ocean L&F.

To reproduce: start up Java2Demo with any recent nightly build containing the
new Ocean L&F.  Click on the "Clipping" tab, and look at the toolbar for the
"Areas" demo (or any other panel in that tab).  The selected button (e.g.
"nop") background color should be green, as it is with the venerable Steel
L&F, but the green background does not show up with the Ocean L&F.
Work Around
Explicitly set the opacity of the button, eg 
button.setOpaque(true);
  xxxxx@xxxxx   2003-08-19
Evaluation
Ocean makes any widgets added to a toolbar !opaque, which means they typically
won't paint their background. Java2Demo is toggling the selected state of
the JButtons as well as the background color to get a particular effect.
As there may be others doing this sort of thing an easy compromise is for
MetalButtonUI to render the background if it's in a toolbar and a selected
state.
  xxxxx@xxxxx   2003-08-19

As there seem to be a couple of problems cropping up with how Ocean renders
some widgets I've changed the synopsis to:
'Backward compatability problems with Ocean'.
The following will be changed:
. Buttons will no longer draw a gradient if the background is not a UIResource.
. Toolbars will no longer change the opacity of their children.  This means
  you won't see the gradient behind toolbar buttons as you previously could,
  but to get this to work in a backward compatable way is problematic and not
  possible.
. Menus/Toolbars will not draw a gradient if the background is not a UIResource.
  xxxxx@xxxxx   2003-12-04
Comments
  
  Include a link with my name & email   

Submitted On 18-NOV-2004
genericprodigy
It is not clear how to ensure that the gradient IS used with custom colours.  For example if a developer changes the blue gradient colour to red then how can the developer ensure that this colour is part of the gradient rather than a solid flat colour?



PLEASE NOTE: JDK6 is formerly known as Project Mustang