Results 1 to 5 of 5
Thread: JComboBox Date
- 02-11-2010, 03:16 PM #1
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
JComboBox Date
I have 3 ComboBox's. 1 for the date, 1 for the month and 1 for the year. Once the user has selected thier DOB using them, i get the selected item from each of the boxes by using the .getSeletedItem method. However i want to be able to join all the values together so i can save it as a Date type. Can someone please point me in the right direction. Tried searching for ages but i cant find nothing.
thanks
-
One possible way: use your data to create a String representation of the date, and then use SimpleDateFormat to parse the String. Another way, create a GregorianCalendar object with the data and then call getTime() on this object to return a Date object.
- 02-11-2010, 07:34 PM #3
Member
- Join Date
- Feb 2010
- Posts
- 5
- Rep Power
- 0
ok done it now
thanksLast edited by idi; 02-11-2010 at 07:38 PM.
- 11-03-2010, 08:09 PM #4
Member
- Join Date
- Nov 2010
- Posts
- 1
- Rep Power
- 0
could you tell me how you solved it? kind of stuck in the same position! :-)
- 11-03-2010, 10:21 PM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,547
- Rep Power
- 11
Similar Threads
-
Activate JComboBox 1 when object is selected in JComboBox 2...
By bahumbaba in forum AWT / SwingReplies: 2Last Post: 12-10-2009, 01:58 PM -
julian date to full date format
By judy318 in forum New To JavaReplies: 7Last Post: 11-02-2009, 12:17 PM -
Compare date input to database with current date
By hungleon88 in forum Advanced JavaReplies: 2Last Post: 11-25-2008, 08:10 AM -
Creating a Gregorian Calendar using a Date object gives date - 1
By prachi_goliwadekar in forum New To JavaReplies: 1Last Post: 05-08-2008, 08:32 PM -
Difference between current date and anothe date
By vijay balusamy in forum New To JavaReplies: 1Last Post: 04-16-2008, 04:15 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks