This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Extending JSlider  RSS feed

 
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!