• 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

Working with JdateChooser

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need a help. i am doing reservation system my doubt is

i have 2 jdate chooser and text box and one jdatechooser is for start and one for end

for an example user selecting date from start date chooser and after that he entering the no of year in a text field. so automatically end date chooser changes the year where user cant edit the end date chooser

Step 1 Select the Date from Date chooser start

Step 2 enter the no of year in jtextbox

Step 3 automatically the end datechoser value changes
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that jdatechooser thing Javascript or a Java class?
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:Is that jdatechooser thing Javascript or a Java class?


Java Class. if you can help me, i would be glad
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

anesly manoj wrote:

K. Tsang wrote:Is that jdatechooser thing Javascript or a Java class?


Java Class. if you can help me, i would be glad


and working with netbeans
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The choice of IDE is irrelevant.

There's bound to be multiple widgets around that are named "jdatechooser", so it's hard to advise specifically, but have you looked through its javadocs in detail? I'm sure there are methods to set the year, and most likely also a method to lock the widget against changes.
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:The choice of IDE is irrelevant.

There's bound to be multiple widgets around that are named "jdatechooser", so it's hard to advise specifically, but have you looked through its javadocs in detail? I'm sure there are methods to set the year, and most likely also a method to lock the widget against changes.



no i have 2, one call start and nother one call end
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please supply some more details. Where did you get the date chooser from? Who wrote it? Where is its documentation? If we don't know that sort of thing, how can we help you?
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Welcome to the Ranch

Please supply some more details. Where did you get the date chooser from? Who wrote it? Where is its documentation? If we don't know that sort of thing, how can we help you?



pls check the image!!! you will get me what im trying to see
pls-check-this.png
[Thumbnail for pls-check-this.png]
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this the one you are using?
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:Is this the one you are using?



yes i need the code for these
 
Campbell Ritchie
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you been through Toedter's documentation?
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
About the payment validity, if it is indeed read-only (generated based on other 2 parameters), I suggest you don't use the date chooser but make it a JLabel or read-only JTextField.

The key is getting the value (date) from the JDateChooser and the year from the JTextField. The JTextField is simple getText(). The JDateChooser API has a getCalendar() and getDate(), you could use either one I suppose. Then get the year from this date or calendar then do your math. Format the output (end date) accordingly to yyyy-mm-dd or whatever.

Looks simple isn't it.
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

K. Tsang wrote:About the payment validity, if it is indeed read-only (generated based on other 2 parameters), I suggest you don't use the date chooser but make it a JLabel or read-only JTextField.

The key is getting the value (date) from the JDateChooser and the year from the JTextField. The JTextField is simple getText(). The JDateChooser API has a getCalendar() and getDate(), you could use either one I suppose. Then get the year from this date or calendar then do your math. Format the output (end date) accordingly to yyyy-mm-dd or whatever.

Looks simple isn't it.


thanx alot! did the same! working really well! thanx cheers
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic