fenec
fenec

Reputation: 5806

what is the best way to use dates with java swing

what i want to do is having like the java script popup date chooser in my application. i am using java swing and would like to avoid any input mistakes by the user. specifying a format is easy to implement but not user friendly for the user. what are your suggestion ? any libraries?

Upvotes: 3

Views: 638

Answers (3)

Matthew Flaschen
Matthew Flaschen

Reputation: 284786

Use a date picker, like JCalendar or JDatePicker. Since users can't type raw date strings, you don't have to worry about their mistakes.

Edit: drhorrible is right. I've fixed the link now.

Upvotes: 3

juanheyns
juanheyns

Reputation: 86

There was a commercial product called JDatePicker (I see this domain is now parked), the open source project which I started in 2004 with the same name has no relation to it. I not 100% sure who had the name first, but it seems like the former is no longer available.

You can find the open source JDatePicker on GitHub or SourceForge. The open source project will stay active as long as someone will need it.

Upvotes: 0

Mark
Mark

Reputation: 29119

There are a number of date picker libraries for Swing.

I have used the JXDatePicker from SwingX and JCalendar in the past.

Upvotes: 4

Related Questions