Guest
Public paste!

stijn leenknegt

By: a guest | Feb 17th, 2010 | Syntax: Java | Size: 0.58 KB | Hits: 127 | Expires: Never
Copy text to clipboard
  1. /**
  2.  * This method gets called when a bound property is changed.
  3.  * @param e A <code>PropertyChangeEvent</code> object describing
  4.  * the event source and the property that has changed. Must not be null.
  5.  *
  6.  * @throws NullPointerException if the parameter is null.
  7.  * @since 1.5
  8.  */
  9. public void propertyChange(PropertyChangeEvent e) {
  10.         String propertyName = e.getPropertyName();
  11.         if (propertyName == "horizontalScrollBar" ||
  12.         propertyName == "verticalScrollBar") {
  13.        
  14.         if (e.getNewValue() instanceof JScrollBar) {
  15.                 setScrollBarRelations((JScrollBar)e.getNewValue());
  16.         }
  17.         }
  18. }