@Override protected void propertyChange(PropertyChangeEvent evt){
  super.propertyChange(evt);
  String name=evt.getPropertyName();
  if (name.equals("foreground")) {
    updateForeground((Color)evt.getNewValue());
  }
 else   if (name.equals("font")) {
    updateFont((Font)evt.getNewValue());
  }
 else   if (name.equals("document")) {
    JComponent comp=getComponent();
    updateForeground(comp.getForeground());
    updateFont(comp.getFont());
  }
}

@ Override protected void propertyChange ( PropertyChangeEvent evt ) { super . propertyChange ( evt ) ; String name = evt . getPropertyName ( ) ; if ( name . equals ( "foreground" ) ) { updateForeground ( ( Color ) evt . getNewValue ( ) ) ; } else if ( name . equals ( "font" ) ) { updateFont ( ( Font ) evt . getNewValue ( ) ) ; } else if ( name . equals ( "document" ) ) { JComponent comp = getComponent ( ) ; updateForeground ( comp . getForeground ( ) ) ; updateFont ( comp . getFont ( ) ) ; } }
this method gets called when a bound property is changed on the associated jtextcomponent . this is a hook which ui implementations may change to reflect how the ui displays bound properties of jtextcomponent subclasses . if the font , foreground or document has changed , the the appropriate property is set in the default style of the document .
