JSlider is a Java Swing component that lets the user graphically select a value by sliding a knob within a bounded interval.
Questions tagged [jslider]
381 questions
3
votes
1 answer
Java - JSlider customized but when its loaded, it does not show same style, how it was expected
I have this custom JSlider, which will be used in many other forms/windows. But when i use MyJSlider it shows the following style:
Expected output was:
YumYumYum.java:
import java.awt.EventQueue;
import javax.swing.JFrame;
import…
user285594
3
votes
1 answer
Adding an adjustable rotating image to the knob of a Jslider.
The knob of the JSlider originally has only 1 degree of freedom (it translates on the track either horizontally or vertically). I want to add a 2nd degree of freedom to the knob and manually rotate it. In other words, I want to be able to move the…

maroon
- 31
- 1
2
votes
1 answer
ChangeListener is not firing
I'm learning about change listeners and would like to find out why a part of my coding is not making a change listener fire when the user moves a slider.
Here is the listener. Everything is in the same method:
ChangeListener lst = new…

Emad-ud-deen
- 4,734
- 21
- 87
- 152
2
votes
1 answer
JSlider not drawing on null layout JPanel
I have a JPanel that has a null layout and I'm trying to add a JSlider:
slider = new JSlider();
slider.setSize(300,30);
slider.setPreferredSize(new Dimension(300,30));
int x =…

CodeGuy
- 28,427
- 76
- 200
- 317
2
votes
3 answers
Using JSlider to create a date chooser?
I want to implement a date chooser using a JSlider. The user should be able to use the slider to freely choose between two previously known dates. I've seen examples like this one:
But I want to do the same, using only one slider. The minimal…
anon
2
votes
1 answer
Range Slider or Multi Thumb Slider for SWING
I need a Multi Thumb Slider for Java. I would need a MultiThumb that can represent a range (so with 2 thumbs) but until now, I can't find any starting point. It must be:
consistent with the Nimbus look & Feel
usable (pluggable) in Netbeans…

musikele
- 355
- 2
- 15
2
votes
1 answer
Extending Java Swing Widgets (Wish to add animation and extra markers to JSlider)
I am interested in creating a new widget similar to the JSlider widget, but with a "ghost" (translucent) knob displaying the previous slider position, as well as adding a trails-like animation to the real knob's movement.
I am a bit confused on the…

kashiko
- 173
- 1
- 6
2
votes
2 answers
Is it Possible to Click two JSliders At once
I am trying to select a coordinate from a grid using JSliders. Can I make it so when it clicks one it clicks the other as well, one is vertical while the other is horizontal? So I can drag them both at once.
What I'm trying to do is set the…

Maxwell Dergosits
- 297
- 1
- 4
- 12
2
votes
2 answers
JSlider - clicking makes the dot go towards that direction
I have a JSlider with minimum value of 0 and max value of 100. When the JSlider first launches, the value is 0.
Now, when I click my mouse on the 50, or even the 20 or 100, the JSlider doesn't move to the location I click. It simply jumps a little…

CodeGuy
- 28,427
- 76
- 200
- 317
2
votes
1 answer
Circle JSlider - Java program
Can someone show me code that will set up a JSlider except, instead of a thumb, it is a circle? Specifically, instead of that little triangle which points to the current position, it is a blue circle of width 100;

CodeGuy
- 28,427
- 76
- 200
- 317
2
votes
2 answers
Dynamically added elements don't load in my jQuery slider
My page currently uses Slides
I want to be able to add new "slides" to my slider dynamically. The way I do this is through an XML document, which contains a link to the "slide image" and the href.
My jQuery code to dynamically add elements is…

Jack Marchetti
- 15,536
- 14
- 81
- 117
2
votes
3 answers
problem with setLabelTable method to customize JSlider's lables
According to this tutorial, one should do the following to customize JSlider's lables:
JSlider framesPerSecond = new JSlider(JSlider.VERTICAL,
FPS_MIN, FPS_MAX,…

Heisenbug
- 38,762
- 28
- 132
- 190
2
votes
2 answers
Get access to Thumb/Handle/Knob of Swing's JSlider
Basically I want to display the current value pointed to by the slider handle when in motion (either via mouse or keyboard). I can easily get the current value by adding a new ChangeListener & overriding stateChanged method. But I cant seem to get…

Chantz
- 5,883
- 10
- 56
- 79
2
votes
2 answers
Custom range to use with JSlider
I'm trying to create a jslider that moves withing the following ranges.
[-x,-1)[1,x]
In short I don't want the values -1 and 0 to be valid values for the JSlider.
But the values from x to -1 should be allowed, and 1 to x should be allowed.
I'm…

Varun Madiath
- 3,152
- 4
- 30
- 46
2
votes
1 answer
Java JSlider: Dictionary is deprecated for method setLabelTable, what else should I use?
I am currently trying to setup a custom label for a JSlider in Java.
I looked up into the Java API and found this method: public void setLabelTable(Dictionary labels)
Unfortunately it turns out the Dictionary class and it's subclass Hashtable is…

Kcits970
- 640
- 1
- 5
- 23