Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set a default value for spinner

 
Eder Suarez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there, I have more than one hour-choose spinner. The thing is, when i run my program, the default value is the actual time. Is there a way of setting the default value to "00:00"?

Thanks in advance.


Here's the code:

 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a guess after looking at the JavaDoc: setValue()?
 
Rob Spoor
Sheriff
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a Date object with a time of 00:00, and set that for the spinner. You can use java.util.Calendar to get such a Date object. Another option is to use new Date(0), but I'm not sure how that will work out.
 
Eder Suarez
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot! This did it:






 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic