my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes JSlider with decimal point increments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JSlider with decimal point increments" Watch "JSlider with decimal point increments" New topic

JSlider with decimal point increments

Jody Monahan

Joined: Feb 10, 2010
Posts: 20
Hi all,

I was just wondering if it is possible to set a JSlider with a minimum of '0' and a max of '1' with increments of lets say '0.1'?

I have obviously tried the following code, however it displays only one label - '0' and only one tick, also at '0'.

Any help would be greatly appreciated.

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
not sure if there's any new inbuilt way to do it, but here's the old way

I agree. Here's the link:
subject: JSlider with decimal point increments
It's not a secret anymore!