wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JSlider works but doesn't 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 works but doesn Watch "JSlider works but doesn New topic
Author

JSlider works but doesn't "slide"

Joshua Amy
Greenhorn

Joined: Dec 17, 2011
Posts: 12
I'm currently learning how swing works and trying to write a program that allows a user to add stars to a canvas (an exercise set forth in Roberts' Art and Science of Java). Everything works except the slider, which doesn't actually "slide" when I run it from eclipse. It does what it's supposed to do, (resize the stars), but the slider button itself doesn't move when you grab it and slide left or right. Is this a problem with the code or something strange in Eclipse, perhaps? Any help is appreciated.

Joshua Amy
Greenhorn

Joined: Dec 17, 2011
Posts: 12
Furthermore, when you use the JComboBox, it will select the right color, but only shows the default "White" in the combo box.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
both the comboBox and slider worked OK for me.

problem is likely to be in your custom classes
Joshua Amy
Greenhorn

Joined: Dec 17, 2011
Posts: 12
Thanks. I'm using Eclipse 4.1; do you have any idea what I might try to change? I think everything is default, since I don't really know enough to mess around with the settings (often I change the application size, but that's all).
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
doubtful the problem is in eclipse. more likely to be in
extends GraphicsProgram or
addMouseListeners();

perhaps addMouseListeners() removes/overrides the slider/sliderUI listeners
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38016
    
  22
Moving to where we usually discuss GIU questions.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSlider works but doesn't "slide"
 
Similar Threads
background color of a jframe
A confused new user of Java that needs some help
JCheckBox works but doesn't toggle graphically
slider in bean
Resizing Panels inside a Jframe ??