title: Why is firePropertyChange(String propertyName, Object oldValue, Object newValue) protected and not public?
body: <p>Well the thing is I'm working on a <code>IDateEditor</code> interface implementation from <a href="http://www.toedter.com/en/jcalendar/" rel="nofollow noreferrer">JCalendar</a> library and I've noticed that <a href="http://docs.oracle.com/javase/7/docs/api/java/awt/Component.html#firePropertyChange%28java.lang.String,%20java.lang.Object,%20java.lang.Object%29" rel="nofollow noreferrer">Component.firePropertyChange(String propertyName, Object oldValue, Object newValue)</a> method is not public but protected. The situation is illustrated below:</p>
  
  <pre><code>public class DateFormattedTextField implements IDateEditor {
  
      private JFormattedTextField editor;        
      private DateUtil dateUtil;
  
      ...
  
      @Override
      public void setDate(Date date) {
          Date oldDate = (Date)editor.getValue();            
          if(dateUtil.checkDate(date)){
              editor.setValue(date);
              editor.firePropertyChange("date", oldDate, date); // &lt;-- error here
          }
      }
  
  }
  </code></pre>
  
  <p>As you can see I'm not able to fire a property change because of this method being protected. Of course if I make my class extending from <a href="http://docs.oracle.com/javase/7/docs/api/javax/swing/JFormattedTextField.html" rel="nofollow noreferrer">JFormattedTextfield</a> instead of using a simple variable I could easily get rid of this problem.</p>
  
  <pre><code>public class DateFormattedTextField extends JFormattedTextField implements IDateEditor {
  
      private DateUtil dateUtil;
  
      ...
  
      @Override
      public void setDate(Date date) {
          Date oldDate = (Date)getValue();            
          if(dateUtil.checkDate(date)){
              setValue(date);
              firePropertyChange("date", oldDate, date); // &lt;-- No problem here
          }
      }
  }
  </code></pre>
  
  <p>But that's not what I'm asking. I would like to know: <em>why is this method protected?</em></p>
  
  <p>I know it should be some design matter but I can't figure out why is that, especially considering that most of methods to fire property change events are public:</p>
  
  <p><img src="https://i.stack.imgur.com/GkLZT.jpg" alt="enter image description here"></p>
  
  <p>Maybe most experienced developers can shed some light on this. Thanks in advance.</p>
  
  <h3>Addendum:</h3>
  
  <p>Here  is my code so far. Feel free to use/modify/play-with it.</p>
  
  <pre><code>public class DateFormattedTextField implements IDateEditor {
  
      private JFormattedTextField editor;        
      private DateUtil dateUtil;
      private DateFormat dateFormat;
      private String dateFormatString;
  
      public DateFormattedTextField(){
          dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM);
          editor = new JFormattedTextField(dateFormat);
          editor.setColumns(10);
          editor.setFocusLostBehavior(JFormattedTextField.COMMIT_OR_REVERT);
          dateUtil = new DateUtil();            
      }
  
      @Override
      public Date getDate() {
          return (Date)editor.getValue();
      }
  
      @Override
      public void setDate(Date date) {
          Date oldDate = (Date)editor.getValue();            
          if(dateUtil.checkDate(date)){
              editor.setValue(date);
              editor.firePropertyChange("date", oldDate, date); // &lt;-- error here
          }
      }
  
      @Override
      public void setDateFormatString(String dateFormatString) {
          this.dateFormatString = dateFormatString;
      }
  
      @Override
      public String getDateFormatString() {
          return this.dateFormatString;
      }
  
      @Override
      public void setSelectableDateRange(Date min, Date max) {
          dateUtil.setSelectableDateRange(min, max);
      }
  
      @Override
      public Date getMaxSelectableDate() {
          return dateUtil.getMaxSelectableDate();
      }
  
      @Override
      public Date getMinSelectableDate() {
          return dateUtil.getMinSelectableDate();
      }
  
      @Override
      public void setMaxSelectableDate(Date max) {
          dateUtil.setMaxSelectableDate(max);
      }
  
      @Override
      public void setMinSelectableDate(Date min) {
          dateUtil.setMinSelectableDate(min);
      }
  
      @Override
      public JComponent getUiComponent() {
          return editor;
      }
  
      @Override
      public void setLocale(Locale locale) {
          editor.setLocale(locale); // to be reviewed
      }
  
      @Override
      public void setEnabled(boolean enabled) {
          editor.setEnabled(enabled);
      }
  
      @Override
      public void addPropertyChangeListener(PropertyChangeListener listener) {
          editor.addPropertyChangeListener(listener);
      }
  
      @Override
      public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
          editor.addPropertyChangeListener(propertyName, listener);
      }
  
      @Override
      public void removePropertyChangeListener(PropertyChangeListener listener) {
          editor.removePropertyChangeListener(listener);
      }
  
      @Override
      public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
          editor.removePropertyChangeListener(propertyName, listener);
      }
  }
  </code></pre>