• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

2 JSpinners with SpinnerModels

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have the following code:



However when I build my app and then go to the screen the spinDateEnteredFrom is 2 weeks ago (28/12/2008) but the top arrow on the spinner is greyed out as though the date for two weeks ago is the max date rather than today (11/01/2009).

spinDateEnteredTo also has its top arrow greyed out but that is what I want as the user shouldn't be able to search for anything beyond today's date.

Can someone please tell me how I can set the maximum allowable date for both JSpinners to be the current date?

I have attached an image of the above problem as well with both up arrows greyed out.

Thank you for any suggestions.

Peter.
Screenshot.png
[Thumbnail for Screenshot.png]
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Peter Dennis wrote:


You've specified MONTH to be the change when you press up / down, so if you press up it would add one month, leading to 28-01-2009 which is beyond the maximum value. So that's why you can't have a later date.

If you want separate days you need to use days as the calendar field.
 
Peter Dennis
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:

Peter Dennis wrote:


You've specified MONTH to be the change when you press up / down, so if you press up it would add one month, leading to 28-01-2009 which is beyond the maximum value. So that's why you can't have a later date.

If you want separate days you need to use days as the calendar field.



Thank you so much Rob for the quick response! Awesome!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic