public final void setTable ( PropertySheetTable table ) { if ( table == null ) { throw new IllegalArgumentException ( "table must not be null" ) ; } // remove the property change listener from any previous model if ( model != null ) { model . removePropertyChangeListener ( this ) ; } // get the model from the table model = ( PropertySheetTableModel ) table . getModel ( ) ; model . addPropertyChangeListener ( this ) ; // remove the listener from the old table if ( this . table != null ) { this . table . getSelectionModel ( ) . removeListSelectionListener ( selectionListener ) ; } // prepare the new table table . getSelectionModel ( ) . addListSelectionListener ( selectionListener ) ; tableScroll . getViewport ( ) . setView ( table ) ; // use the new table as our table this . table = table ; }
Sets the table used by this panel .