• Post Reply Bookmark Topic Watch Topic
  • New Topic

DATE  RSS feed

 
Shyam Sunder
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HOW to achive this scenario?.
user might seletct any of the month in the combo box. Assuming user selected jan 26 2006 i should get the date which user selected should be between dec 2005 and feb 2006
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please reserve this forum for advanced questions. I have moved this post to the beginnner's forum.
 
Steffen Reinhard
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shyam Sunder:
HOW to achive this scenario?.
user might seletct any of the month in the combo box. Assuming user selected jan 26 2006 i should get the date which user selected should be between dec 2005 and feb 2006


Why use a Date object in the first place? Try using a java.util.Calendar object. As the Calendar class is abstract, you need to write the following code to get a calendar instance:

Calendar cal = Calendar.getInstance();

Your Calendar instance offers you a really vast variety of fields (i.e. pieces of Date information) you can handle in your application (e.g. for setting the selectedIndex values in your ComboBoxes).

I hope this helps,

cheers,


Steffen
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!