]> git.mxchange.org Git - addressbook-lib.git/blobdiff - Addressbook/src/org/mxchange/addressbook/client/gui/AddressbookFrame.java
Fixes for broken commit, as type-hints must be fixed or casted
[addressbook-lib.git] / Addressbook / src / org / mxchange / addressbook / client / gui / AddressbookFrame.java
index 06d8d0298d7f0ec29313516c0f9d83426a2d285a..c5d05e369d48e87b28da7dbff1ec381509ffebfe 100644 (file)
@@ -49,6 +49,7 @@ import org.mxchange.addressbook.application.AddressbookApplication;
 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;
 
@@ -403,7 +404,7 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
 
                // 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);
@@ -638,7 +639,13 @@ public class AddressbookFrame extends BaseFrameworkSystem implements ClientFrame
                         */
                        @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);
+                               }
                        }
                });