Search code examples
javajdatechooser

java Jdatechooser default month


I have a JDateChooser and I set a range of dates. If the range is in an another month than the current the JDateChooser open by default on the current month... If I use setDate() and give a date in the range it's works but I would like than the textfield stay empty at the opening.

Anybody know how do that ?


Solution

  • When you create the object, pass a true to the constructor. This will cause it to appear empty initially.

    JDateChooser datefield = new JDateChooser(true);
    

    Source