Java Swing - Drawing markers on JSlider.

Posted by Tony Day on Stack Overflow See other posts from Stack Overflow or by Tony Day
Published on 2010-03-12T11:02:07Z Indexed on 2010/03/12 12:47 UTC
Read the original article Hit count: 372

Filed under:
|
|
|

Hi,

I have a progress bar which inherits from JSlider to provide highlighting functionality. Highlights can be added to the slider at a point (and a Color) and these are then painted onto the control. As follows:

The problem is that I cannot get the highlights in the right place, they need to be in the same location as the markers. I also do not know how to retrieve the left and right margins to where the markers start and end.

Is there anyway to get the coordinates of each marker? Or perhaps a better way of performing this task?

Many Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about swing