public void selectionChanged() { int[] selRows = dataTable.getSelectedRows(); boolean hasSelection = (selRows != null && selRows.length != 0); removeAction.setEnabled(hasSelection); frame.setRemoveActionEnabled(this, hasSelection); }