title: Java datePicker - How to set default date in JTextfield
body: <p>Im using a DatePicker as part of a form. What i would like is for todays date to be in the JTexfield thats with the JDatePicker when the form opens.</p>
  
  <p>If i use :</p>
  
  <pre><code>            UtilDateModel model = new UtilDateModel();
      model.setDate(2014, 06, 06);
      JDatePanelImpl datePanel = new JDatePanelImpl(model);
      JDatePickerImpl datePicker = new JDatePickerImpl(datePanel);
  </code></pre>
  
  <p>All it does is set the date in the popup box. What i need it to do is be on the form as soon as it opens</p>
  
  <p>I want it to be like this when its first opened.</p>
  
  <p><img src="https://i.stack.imgur.com/zFqlH.png" alt="enter image description here"></p>
  
  <p>But its like this</p>
  
  <p><img src="https://i.stack.imgur.com/1lceI.png" alt="enter image description here"></p>
  
  <p>Found the answer.</p>
  
  <p>Ue the method</p>
  
  <pre><code>model.setSelected(true);
  </code></pre>
  
  <p>After setting the initial time.</p>