Reputation: 134270
What are good Java Swing date-chooser components? So far I've only really found these 2:
JCalendar
- this one is pretty good as it uses the underlying look and feel.JXMonthView
in the SwingX project - not so good as it uses its own look and feelBoth of these look a bit clunky when compared with some I've seen on web-pages. For example, it might be nice to see multiple months at the same time. Does anyone know of any other good widgets out there?
Upvotes: 27
Views: 89961
Reputation: 3254
I came across this question myself recently. Found most of the answers obsolete or unsatisfactory so I created my own:
It is fully localized and available as part of the Sierra project on GitHub:
https://github.com/HTTP-RPC/Sierra
A time picker is also available:
Upvotes: 1
Reputation: 971
I've tried most of the date pickers out there.
I would suggest LGoodDatePicker.
https://github.com/LGoodDatePicker/LGoodDatePicker
Fair disclosure: I am the primary developer.
Here is a general feature list (as adapted from Github):
Screenshots below:
Upvotes: 8
Reputation: 19
jDateChooser which comes with jCalendar is the best component for date: Following is the way to get date from date picker:
//dat is name given to datepicker component
int day=dat.getJCalendar().getDayChooser().getDay();
int month=dat.getJCalendar().getMonthChooser().getMonth();
int year=dat.getJCalendar().getYearChooser().getYear();
String dateNow=year+"/"+month+"/"+day;
System.out.println(dateNow);
//***************************************************
//For setting date of date picker:
dat.setDateFormatString("dd-MM-yyyy");
Calendar currentDate = Calendar.getInstance();
dat.setDate(currentDate.getTime());
Upvotes: 0
Reputation: 1427
I'm often late but the best i've seen is : JDatePicker
(What has surprised me : week start with Sunday - like many Calendar and by the way Sunday is day 0 in Java - but you can edit the source and recompile to get it start with Monday instead ;-) )
Upvotes: 2
Reputation: 1248
Recently I found and use the Microba DatePicker (http://microba.sourceforge.net/) for a personal project involving Swing GUIs, and I actually I really liked the way this control is implemented. Besides, the license is BSD, so you will be able to customize the control and use it for commercial purposes if you need to do so.
Upvotes: 16