I am using the below library JCalender, which is a Date Picker GUI which we can put into Netbeans pallet.
Date date = showDateChooser.getDate();
DateFormat dateformat1 = new SimpleDateFormat("E");
String day = dateformat1.format(date);
DateFormat dateFormat2 = new SimpleDateFormat("yyyy/MM/dd");
String showDate = dateFormat2.format(date);
Since you neither linked to, nor named the
JCalendar
implementation that you are using, I assume it is JCalendar by Kai Tödter. - At least what I can tell from your screenshot.Using the component is fairly simple, this example should do:
Unfortunately, you also did not provide the code you use for initialization of the component. You can call the
JCalendar
constructor either without parameters, passing aDate
object, aCalendar
object, aLocale
object or various combinations of the before mentioned.Here is a complete list of valid constructors:
To determine the user's selection, you can call
getCalendar()
orgetDate()
. To set an initial date, usesetCalendar()
orsetDate()
respectively. Hope that gets you started. If you have any problems, feel free to edit your question or leave a comment.Also, did you check the sample project contained in the JCalendar ZIP file?