• Post Reply Bookmark Topic Watch Topic
  • New Topic

Extending JSlider

 
Graham Clark
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to extend the Swing JSlider class, as I need a (horizontal) slider which gets thicker at both ends, i.e. the bit that you slide the knob along is kind of bow-tie shaped. Maybe the knob could also change in size in relation to its position. How would I go about doing this, i.e. which method(s) to override, or would be easier to code it from scratch?
thanks,
Graham.
 
Jim Hollandsworth
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to extend
javax.swing.plaf.basic.BasicSliderUI
and override the paintTrack method. Then install this UI onto your JSlider.
Hope this helps
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!