setting Swing l&f to use a gradient
- From: "mitch" <mgart@xxxxxxxxxx>
- Date: 27 Jun 2006 06:25:02 -0700
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.
.
- Follow-Ups:
- Re: setting Swing l&f to use a gradient
- From: mitch
- Re: setting Swing l&f to use a gradient
- Prev by Date: JDK 1.6 and JFrame icon
- Next by Date: Re: JDK 1.6 and JFrame icon
- Previous by thread: JDK 1.6 and JFrame icon
- Next by thread: Re: setting Swing l&f to use a gradient
- Index(es):