It does not have a built-in indicator of the current value. It will label the slider with tick marks and calibrations. By default, the labels of the calibrations are in integer ticks. To get something else, you need a lookup Hashtable<Integer,JLabel> (not String as you would expect) where the JLabels display text or an icon for the important ticks. You have no control over the Font or Color of the calibrations. They take on the the colour of the JFrame they are embedded in. If you try too big a range on too short a slider, you get gibberish since the calibrations overlap. JSliders work for both negative and positive values.
Here is what one looks like with custom calibrations. Note this one lets you position the slider half-way between ticks.
Here is the basic code you will need.
This page is posted |
http://mindprod.com/jgloss/jslider.html | |
Optional Replicator mirror
|
J:\mindprod\jgloss\jslider.html | |
Please read the feedback from other visitors,
or send your own feedback about the site. Contact Roedy. Please feel free to link to this page without explicit permission. | ||
Canadian
Mind
Products
IP:[65.110.21.43] Your face IP:[18.97.14.84] |
| |
Feedback |
You are visitor number | |