import org.mxchange.addressbook.client.Client;
import org.mxchange.addressbook.contact.Contact;
import org.mxchange.addressbook.contact.Gender;
+import org.mxchange.addressbook.exceptions.ContactAlreadyAddedException;
import org.mxchange.addressbook.exceptions.FrameAlreadyInitializedException;
import org.mxchange.addressbook.model.contact.ContactTableModel;
// Only hide it on close and make it appear in middle of screen
this.addContact.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
- this.addContact.setLocationRelativeTo(null);
+ this.addContact.setLocationRelativeTo(this.frame);
// Set always on top and auto-focus
this.addContact.setAlwaysOnTop(true);
*/
@Override
public void actionPerformed (final ActionEvent e) {
- self.getClient().getContactManager().doEnterOwnData();
+ try {
+ self.getClient().getContactManager().doEnterOwnData();
+ } catch (final ContactAlreadyAddedException ex) {
+ // Already added, log away
+ // @TODO maybe output message here?
+ self.logException(ex);
+ }
}
});