File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 217
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: 217
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSpinner Problem