2

How to print DD/MM/YYYY on JDateChooser field?

JDateChooser jdc=new JDateChooser();

i am using JDateChooser for selecting date, But i also want to facilitate type date in DD/MM/YYYY format.

enter image description here

DNP
  • 501
  • 4
  • 9
Daxesh Prajapati
  • 151
  • 3
  • 13

2 Answers2

4

The api has a method setDateFormatString

http://www.toedter.com/en/jcalendar/api/com/toedter/calendar/JDateChooser.html#setDateFormatString(java.lang.String)

Ashish
  • 510
  • 3
  • 14
1

From the api, I'd use the JDateChooser(java.lang.String dateFormatString, boolean startEmpty) constructor as so;

JDateChooser jdc = new JDateChooser("DD/MM/YYYY", true);
Elliott Frisch
  • 198,278
  • 20
  • 158
  • 249