edit.setEnabled(users.getSelectedIndex() > 1);
edit.addActionListener(new ActionListener() {
@Override
public void actionPerformed (ActionEvent event) {
if (users.getSelectedIndex() > 1) {
ProfileEditorDialog p = new ProfileEditorDialog(getInstance(), (String) users.getSelectedItem(), true);
users.setSelectedIndex(0);
p.setVisible(true);
}
edit.setEnabled(users.getSelectedIndex() > 1);
}
});