/** Updates the state of buttons according to the current selection */
 private void updateControlStates() {
   int[] selItems = historyList.getSelectedIndices();
   removeButton.setEnabled(selItems.length > 0);
 }