title: How to detect if the user changed JDateChooser date and not anything else setting the date property?
body: <p>I use <a href="http://www.toedter.com/en/jcalendar/api/com/toedter/calendar/JDateChooser.html" rel="nofollow" title="JDateChooser">JDateChooser</a> to edit dates in my form.</p>
  
  <p><strong>Short version</strong>: I need to distinguish between <strong>user date edit</strong> and <strong>programmatical property change</strong> on a JDateChooser.</p>
  
  <p><strong>Workaround</strong>: I've found a protected JDateChooser property named <a href="http://www.toedter.com/en/jcalendar/api/com/toedter/calendar/JDateChooser.html#dateSelected" rel="nofollow">dateSelected</a> which is exactly what I need (afaics there is no getter) so probably I'd have to make my own extended JDateChooser class and make a getter for this property. The problem here is that I want to have this custom version to be draggable from the Netbeans Palette and my custom JDateChooser won't be.</p>
  
  <p><strong>Long version:</strong>
  First I get a date from my database and I use the JDateChooser's setDate() method to set the date in the GUI. I want to edit database's date when user picks a new date with the chooser. To do that i listen for a PropertyChange event on the JDateChooser object (looking for the "date" change). After settig the new date in the database, I want to refresh the data (I get the whole record from the database) and I set the date from the database (if there was any error, it gets set back to whatever is in the database at the moment).</p>
  
  <p>The problem is that when I set the date from the database, the same event is fired whe user changes date and then my "refresh" mechanism updates the JDateChooser field and I get infinite loop.</p>
  
  <p><strong>My existing</strong> (simplified) <strong>code</strong> (netbeans):</p>
  
  <pre><code>private void dataStartuChooserPropertyChange(java.beans.PropertyChangeEvent evt) {
      if ("date".equals(evt.getPropertyName())) {
          JDateChooser wybieraczDat = (JDateChooser) evt.getSource();
          updateDatabaseField(wybieraczDat.getDate());
      }
  }
  </code></pre>