Reputation: 738
Is there any date picker for Java Swing when I click the textfield and the calendar pops up and I can choose the date?? (without any extra button please)
Upvotes: 0
Views: 8439
Reputation: 3254
See my answer to this question:
What are good Java date-chooser Swing GUI widgets?
In 2023, I was unable to find any satisfactory implementations so I created my own. It works exactly as described above - when the associated text field receives the input focus, a popup is displayed that allows a user to select the date.
Upvotes: 0
Reputation: 5406
Update: 2019
Under active development, you'll find LGoodDatePicker
These features are included: DatePicker, TimePicker, DateTimePicker, CalendarPanel
Update: 2017
When this question was asked, the SwingX project still existed and JXDatePicker control was one option to use.
Currently I can no longer find any trace of this project and to be honest I don't even know if swing still exists :). I'm marking this answer as community wiki, so if anyone knows anything about this subject he/she can update it freely.
Old answer:
Swingx has a nice JXDatePicker control. Since Oracle moved java.net to kenai it's a bit of an adventure to find anything.
Here is the main page: http://swingx.java.net/
There a JWS demo there too.
and here's the download area
http://java.net/downloads/swingx/releases/1.6.2/
Upvotes: 4
Reputation: 109815
I suggest to use JSpinner (since there no popup window) for implemented SpinnerDateModel
Upvotes: 2
Reputation: 94625
No, there is no date picker component in Java swing. You can try JCalendar - date chooser.
Upvotes: 3