class SwingTree extends AbstractSwingContainer implements XulTree {

  public void setOnselect( final String select ) {
    selectionListener = new ListSelectionListener() {
      public void valueChanged( ListSelectionEvent event ) {
        if ( event.getValueIsAdjusting() == true ) {
          return;
        }
        invoke( select, new Object[] { new Integer( table.getSelectedRow() ) } );
      }
    };

    if ( table != null ) {
      table.getSelectionModel().addListSelectionListener( selectionListener );
    }

    treeSelectionListener = new TreeSelectionListener() {
      public void valueChanged( TreeSelectionEvent e ) {
        if ( tree != null ) {
          invoke( select, new Object[] { tree.getSelectionRows()[0] } );
        }
      }
    };

    if ( tree != null ) {
      tree.getSelectionModel().addTreeSelectionListener( treeSelectionListener );
    }
  }

  public  SwingTree( Element self, XulComponent parent, XulDomContainer domContainer, String tagName );

}