Avatar of mb2297
mb2297

asked on 

JSlider with non-integer tick marks

Hello experts,

I'm using a JSlider and I need it to have non-integer tick marks -- for example a range from 0.1 to 0.6 with minor ticks every 0.05.

I can't believe this isn't possible, but the API doesn't agree. Does such a thing exist?

Thanks,
Matt.

Java

Avatar of undefined
Last Comment
Tommy Braas
ASKER CERTIFIED SOLUTION
Avatar of Tommy Braas
Tommy Braas
Flag of Australia image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mb2297
mb2297

ASKER

Surely the tick labels with then be 20 to 120?
Avatar of Tommy Braas
Tommy Braas
Flag of Australia image

You didn't ask about tick labels, but rather the bounds and the tick values themselves.

However, it is easy to change the labels. Have a look at the "Customizing Labels on a Slider" section on http://java.sun.com/docs/books/tutorial/uiswing/components/slider.html
Avatar of mb2297
mb2297

ASKER

Great, thanks.
Avatar of Tommy Braas
Tommy Braas
Flag of Australia image

;-D
Java
Java

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.

102K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo