Questions tagged [jslider]

JSlider is a Java Swing component that lets the user graphically select a value by sliding a knob within a bounded interval.

379 questions
3
votes
1 answer

JSlider won't show up unless the window is expanded

Hello im making a game using an MVC layout and cannot get the JSlider to become visible. It's working an fully functional, but will not show unless the window is expanded. Here is my method that creates the JSlider in GameView: `public void…
Steve
  • 45
  • 3
3
votes
1 answer

Change first index of major tick spacing

I have a JSlider, range 1 to 60. I have the ticks labeled every 10, starting at 10. My code for the slider is this: JSlider slider = new JSlider(1,…
17slim
  • 1,166
  • 1
  • 14
  • 20
3
votes
1 answer

Display Modified JSlider Value Above Thumb

Is there an easy way to change the value displayed in the label above a JSlider while using certain "look and feel"s? To be clear, I'm talking about this value: Specifically, I would like to show the value divided by 1000 instead of the value…
Vaelus
  • 756
  • 6
  • 20
3
votes
2 answers

How to set size of a JSlider?

I have searched the web for a solution to this problem and didn't find anything that worked. I have a vertical JSlider inside a JPanel that uses GridBagLayout and a GridBagConstraints for positioning the objects on the panel. Currently I have the…
Aviv Cohn
  • 11,431
  • 20
  • 52
  • 95
3
votes
1 answer

I need JTextField to be editable after calling requestFocus() on it's parent container

I have the following window. I need to be able to edit the text when I click on the JTextField. Explanation: JTextField is inside a JComponent called PriorityPanel. When I click on JTextField, it calls this.requestFocus(); meaning that the…
Daniel Katz
  • 1,580
  • 3
  • 17
  • 25
3
votes
2 answers

Jslider should fire change event when it come to rest

I have one slider in my JAVA application.I have written change listener for that slider. Here is the code i have written jSlider = new JSlider(JSlider.HORIZONTAL,0,30,2); jSlider.setFont(new Font("Dialog", Font.BOLD, 10)); …
rachana
  • 3,158
  • 6
  • 27
  • 45
3
votes
2 answers

How to move the JSlider with the mouse wheel

I have this code, but nothing happens. I don't know why the degreesSlider.getValue() + 1 does not work. I would be thankful for any suggestions. degreesSlider.addMouseWheelListener(new MouseWheelListener() { @Override public void…
3
votes
2 answers

How to change JLabel background color using JSlider

JSlider with "ChangeListener" interface and handle"ChangeEvent" that will change JLabel background color when slider value is change.please help me i couldn't do it. thanks in advance.i couldn't apply JLabel package…
Suma
  • 133
  • 4
  • 11
3
votes
1 answer

JDialog appearing everytime my JSlider moves

Everytime I move my JSlider my JDialog box is appearing for each position it is moved, I only want it to be displayed once when the user tries to move the JSlider without them making a selection from my menu. How would I do this? public void…
user1839601
  • 117
  • 8
3
votes
1 answer

Jslider, not appearing on My frame

im trying to make my slider appear on my gui once i run my java project, here is what i >have, any help would be nice :) so the menu bar appears, the menu shapes appears, and the 3 shapes appear too, i just cant >get the slider to appear on at the…
john
  • 65
  • 1
  • 9
3
votes
3 answers

Changing a JLabel's Value from a JSlider's Value

I have a single JPanel that contains a JSlider and a JLabel. I want to configure it so that when the JSlider's value is being changed by the user, that new value is reflected by the JLabel. I understand that I can fire ChangeEvents with the Slider,…
Marco Leung
  • 1,913
  • 2
  • 13
  • 9
3
votes
2 answers

JButton, JCheckBox and similar interactors do not change visually

Here is a simple graphics programs which adds some stars on the screen. import acm.graphics.*; import acm.program.*; import java.awt.event.*; import javax.swing.*; /** * This program creates a five-pointed star every time the * user clicks the…
mgus
  • 768
  • 3
  • 14
  • 31
3
votes
2 answers

Change displayable labels for a JSlider?

I have a JSlider with a min of 0 and a max of 10,000. I have the major tick marks set at 1,000. If I were to paint the labels now they would show up as 0, 1000, 2000, 3000, 4000, etc. What I would like to be shown would be 0, 1, 2, 3, 4, 5, etc.…
soldier.moth
  • 17,709
  • 14
  • 71
  • 88
3
votes
1 answer

jQuery mobile slider discretization and decimal digits

I am currently using jslider for my application but I am in the need of something more mobile friendly. I am looking at the slider in jquery mobile and it looks cool and all, but I am dealing with scientific data and I need to specify arbitrary…
JohnIdol
  • 45,251
  • 58
  • 153
  • 235
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
1 2
3
25 26