private void updateControls() { Note note = tableModel.getNote(table.getSelectedRow()); deleteNoteButton.setEnabled(note != null && note.isCustom()); }