void (ActionEvent e) { if (myCbEncapsulateGet.equals(e.getSource())) { if (!myCbEncapsulateGet.isSelected()) { myCbEncapsulateSet.setSelected(true); } } else { // myCbEncapsulateSet is the source if (!myCbEncapsulateSet.isSelected()) { myCbEncapsulateGet.setSelected(true); } } int[] rows = myTable.getSelectedRows(); myTableModel.fireTableDataChanged(); TableUtil.selectRows(myTable, rows); }