• Post Reply Bookmark Topic Watch Topic
  • New Topic

Making JSpinner act like JSlider

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In a JSlider there is a method getValueIsAdjusting() which checks to see if the slider knob is still being dragged. I can use this method to update things after the slider is no longer being dragged. Is there some way to get this behavior in a JSpinner. That is I only want to update after the value is not being incremented or decremented any more on the JSpinner. I couldn't find anything in the API that suggests there is an easy workaround, and I don't have the option of getting rid of the JSpinner. Thanks for any help.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe you can roll-your-own

something like this - needs major testing

 
Sean Casey
Ranch Hand
Posts: 625
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael,

Thanks for your reply. I did something similar, and then I needed to simulate the holding down of the button so I used a timer to find out how long the button was held down for and incremented/decremented the spinner accordingly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!