United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4908404 Backward compatability problems with Ocean
JDK-4908404 : Backward compatability problems with Ocean

Details
Type:
Bug
Submit Date:
2003-08-18
Status:
Resolved
Updated Date:
2003-12-15
Project Name:
JDK
Resolved Date:
2003-12-15
Component:
client-libs
OS:
solaris_9,linux_suse_sles_8.2,generic,windows_xp,windows_2000
Sub-Component:
javax.swing
CPU:
x86,sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (b32)

Related Reports
Duplicate:
Duplicate:
Duplicate:

Sub Tasks

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.

                                    

Comments
WORK AROUND

Explicitly set the opacity of the button, eg 
button.setOpaque(true);
###@###.### 2003-08-19
                                     
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.
###@###.### 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.
###@###.### 2003-12-04
                                     
2003-12-04
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b32
tiger-beta


                                     
2004-06-14



Hardware and Software, Engineered to Work Together