public void selectAll(){
  if (isEditing()) {
    removeEditor();
  }
  if (getRowCount() > 0 && getColumnCount() > 0) {
    int oldLead;
    int oldAnchor;
    ListSelectionModel selModel;
    selModel=selectionModel;
    selModel.setValueIsAdjusting(true);
    oldLead=getAdjustedIndex(selModel.getLeadSelectionIndex(),true);
    oldAnchor=getAdjustedIndex(selModel.getAnchorSelectionIndex(),true);
    setRowSelectionInterval(0,getRowCount() - 1);
    SwingUtilities2.setLeadAnchorWithoutSelection(selModel,oldLead,oldAnchor);
    selModel.setValueIsAdjusting(false);
    selModel=columnModel.getSelectionModel();
    selModel.setValueIsAdjusting(true);
    oldLead=getAdjustedIndex(selModel.getLeadSelectionIndex(),false);
    oldAnchor=getAdjustedIndex(selModel.getAnchorSelectionIndex(),false);
    setColumnSelectionInterval(0,getColumnCount() - 1);
    SwingUtilities2.setLeadAnchorWithoutSelection(selModel,oldLead,oldAnchor);
    selModel.setValueIsAdjusting(false);
  }
}

public void selectAll ( ) { if ( isEditing ( ) ) { removeEditor ( ) ; } if ( getRowCount ( ) > 0 && getColumnCount ( ) > 0 ) { int oldLead ; int oldAnchor ; ListSelectionModel selModel ; selModel = selectionModel ; selModel . setValueIsAdjusting ( true ) ; oldLead = getAdjustedIndex ( selModel . getLeadSelectionIndex ( ) , true ) ; oldAnchor = getAdjustedIndex ( selModel . getAnchorSelectionIndex ( ) , true ) ; setRowSelectionInterval ( 0 , getRowCount ( ) - 1 ) ; SwingUtilities2 . setLeadAnchorWithoutSelection ( selModel , oldLead , oldAnchor ) ; selModel . setValueIsAdjusting ( false ) ; selModel = columnModel . getSelectionModel ( ) ; selModel . setValueIsAdjusting ( true ) ; oldLead = getAdjustedIndex ( selModel . getLeadSelectionIndex ( ) , false ) ; oldAnchor = getAdjustedIndex ( selModel . getAnchorSelectionIndex ( ) , false ) ; setColumnSelectionInterval ( 0 , getColumnCount ( ) - 1 ) ; SwingUtilities2 . setLeadAnchorWithoutSelection ( selModel , oldLead , oldAnchor ) ; selModel . setValueIsAdjusting ( false ) ; } }
selects all rows , columns , and cells in the table .
