setting Swing l&f to use a gradient



I tried

UIManager.put("MenuBar.gradient", MENUBAR_BG_GRADIENT);

where MENUBAR_BG_GRADIENT is a java.awt.GradientPaint object.
At runtime there is a ClassCastException:

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
java.awt.GradientPaint
at javax.swing.plaf.metal.MetalUtils.drawGradient(Unknown
Source)

It seems to want a ColorUIResource, but this is just a single color,
not a gradient.

Is there a way to set the custom look & feel to use a gradient
for menus, buttons, etc? Thanks.

.