wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JSpinner Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JSpinner Problem" Watch "JSpinner Problem" New topic
Author

JSpinner Problem

Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 210
I have the following JSpinner:

I am using this for a time duration rather than a date/time so I only care about hours and minutes. The JSpinner is doing what I want with one exception. When the spinner is displayed, I can use the arrow to increase/decrease the hours. However, I cannot use the arrows to increase/decrease the minutes. I can highlight either the hours or minutes, but with minutes highlighted, when I click an arrow, it reverts to hours and changes it instead. I can manually type the minutes but that is all. I am guessing this has something to do with the editor but I am hoping it is a simple fix rather than me needing to write my own editor. TIA.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
worked fine for me, hours +/- OK, minutes (when highlighted) also +/- OK (java 6, win 7)
Guillaume Jourdan
Ranch Hand

Joined: Jul 24, 2012
Posts: 47

Hello,

I don't know if this is really a problem, but why you use with SimpleDateFormat the time pattern "h:m"
and with the DateEditor the time pattern "h:mm"

Can you test with :

Dennis Putnam
Ranch Hand

Joined: Feb 03, 2012
Posts: 210
Michael Dunn wrote:worked fine for me, hours +/- OK, minutes (when highlighted) also +/- OK (java 6, win 7)

This is bizarre. Now it works for me too? There was a Win 7 update that required a reboot but that is the only "event" I know about and none of the updates had anything to do with Java. Perhaps just the reboot did something. Sorry for the bother.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSpinner Problem
 
Similar Threads
JSpinner DateModel : Set a date
problem on spinner
jspinner design problem displaying length of a movie
JSpinner Value Format
JSpinner Problem