• Post Reply Bookmark Topic Watch Topic
  • New Topic

Working with JdateChooser  RSS feed

 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
 
K. Tsang
Bartender
Posts: 3633
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • 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
  • 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]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this the one you are using?
 
anesly manoj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Is this the one you are using?


yes i need the code for these
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you been through Toedter's documentation?
 
K. Tsang
Bartender
Posts: 3633
16
Firefox Browser Java Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!