tags:

views:

125

answers:

1

Hi all,

been trying this for a while now and can't seem to get it to work. I wrote a little GUI app that uses the OS's default Look And Feel. While I wrote it on linux, it is mainly intended to be used on Windows. The JSliders under linux are fine by me, but on windows the thumbs(sliders? I don't know the right word) become very narrow, and they stop displaying the value above the thumb, too. I thought I could get around this problem with something like this:

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.getLookAndFeelDefaults().put("Slider.thumbWidth", 20);

But, obviously, it doesn't work. How should I do this? seems like it should be a trivial thing, and I already spent more time on it than I'll ever want to admit.

thanks a lot

A: 

Not all LAFs will use the UIManager properties.

I'm not aware of the "thumbWidth" property. Maybe you meant to use the "trackWidth"?

Here is a complete list of the UIManager Defaults.

camickr
you're right, windows laf doesn't even have thumbWidth property. But that doesn't help me much. How do I change the width of the thumb? p.s. windows laf doesn't seem to have trackWidth either. but it doesn't sound to me like the thing I want, anyways.
vilius
Well, if you don't see a property that might help then you will probably need to change the WindowsSliderUI class to do custom painting. Theres a method calculateThumbSize() that you might be able to overrid.
camickr