Leit?o wrote:
> Hi,
>
[quoted text clipped - 12 lines]
>
> Carlos Leitao
Hi,
I do not get the problem you've got. All components seem to paint
correctly, so the problem you've got could be in another area of your
code.
Besides that, it's possible to change the color of the knob by simply
overriding some UIDefaults values. You could do the following:
java.util.List sliderGradient = Arrays.asList(new Object[] {
new Float(.3f),
new Float(.3f),
new ColorUIResource(0xC8DDF2),
new Color(0x1b, 0x70, 0xe1),
new ColorUIResource( 0x2b, 0x80, 0xF1 )
});
UIManager.getDefaults().put("Slider.gradient", sliderGradient);
UIManager.getDefaults().put("Slider.focusGradient",
sliderGradient);
This way you don't have to implement your own UI.
Note that this will work for the MetalLookAndFeel. Other L&F's might
require other settings to change it.
Regards,
Bart
Leitão - 28 Nov 2006 00:23 GMT
Bart...Thanks for your answer...it really worked for me. Hey...Where
did you find this properties like "Slider.gradient" and
"Slider.focusGradient". Do you know some place where I can get all the
properties I can set like this.
Thanks again,
Carlos
> > Hi,
> >
[quoted text clipped - 42 lines]
>
> Bart
Michael Rauscher - 28 Nov 2006 06:41 GMT
Leitão schrieb:
> Bart...Thanks for your answer...it really worked for me. Hey...Where
> did you find this properties like "Slider.gradient" and
> "Slider.focusGradient". Do you know some place where I can get all the
> properties I can set like this.
It's always good to have a look at the source code. This way you learn
much more than just the available properties. Of course, this is only
possible if you have the source code of the look & feel under
investigation...
Anyway, to get a list of properties of the current look & feel:
System.out.println( UIManager.getLookAndFeelDefaults().keySet() );
Or to get an alphabetically ordered list:
List<Object> keys = new ArrayList<Object>(
UIManager.getLookAndFeelDefaults().keySet() );
Collections.sort( keys, new Comparator<Object>() {
public int compare( Object o1, Object o2) {
return ((String)o1).compareTo((String)o2);
}
public boolean equals() { return false; }
});
for ( Object key : keys )
System.out.println( key );
Bye
Michael