2

Ok, so I have searched google for a while now to see if I can find the answer to this but no dice. Maybe I am just searching for the wrong thing but this is what I want to know:

How do you change the width of the actual Knob on the JSlider component? NOT how to change the width of the JSlider.

Any help would be greatly appreciated!

jt153
  • 111
  • 1
  • 1
  • 4

1 Answers1

2
   BasicSliderUI sliderUI = new javax.swing.plaf.basic.BasicSliderUI(jTimeSlider){
        protected Dimension getThumbSize() {
              return new Dimension(15, 20);
          }
      };
    jTimeSlider.setUI(sliderUI);

where dimension width is the width of the knob.

kleopatra
  • 51,061
  • 28
  • 99
  • 211
  • 1
    not recommended to set a per-instance ui: a) it will not survive changing the LAF b) extending basic sure looks strange in an application using another LAF – kleopatra Nov 09 '11 at 17:05