this.addContact.setAutoRequestFocus(true);
// Initial dimension
- this.addContact.setSize(400, 300);
+ this.addContact.setSize(500, 400);
/*
* Add listener which asks for confirmation, if data has been entered
*/
// Init 3 panels:
- // 1) Panel "name" input boxes
- JPanel namePanel = new JPanel();
- namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.Y_AXIS));
-
- // Set border to titled version
- namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name")));
-
- // Add some input boxes for "name" panel
- JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<Gender>());
-
- // Panel for gender
- JPanel gPanel = new JPanel();
- gPanel.setLayout(new GridLayout(1, 2));
-
- // Set tooltip text
- gPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.tooltipText"));
-
- // Gender text field
- JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
-
- // Add both to gender panel
- gPanel.add(gLabel);
- gPanel.add(gender);
-
- // Add panel to north of "name" panel
- namePanel.add(gPanel, BorderLayout.NORTH);
-
- // Panel for surname
- JPanel sPanel = new JPanel();
- sPanel.setLayout(new GridLayout(1, 2));
-
- // Set too tip text
- sPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.surname.tooltipText"));
-
- // New label for surname is not needed
- JLabel sLabel = new JLabel(this.getBundle().getString("AddressbookFrame.surname.text"));
-
- // And input box
- JTextField surname = new JTextField(20);
-
- // Add both to surname panel
- sPanel.add(sLabel);
- sPanel.add(surname);
-
- // Add surname panel to "name" panel
- namePanel.add(sPanel, BorderLayout.CENTER);
-
- // Finally add panel to dialog
- this.addContact.add(namePanel);
-
- // Only for developing:
- /* DEBUG: */ this.addContact.setVisible(true);
+ // 1) "Name" panel
+ initNamePanel();
}
/**
this.frame.add(menuBar, BorderLayout.NORTH);
}
+ /**
+ * Initializes name panel
+ */
+ private void initNamePanel () {
+ // 1) Panel "name" input boxes
+ JPanel namePanel = new JPanel();
+ namePanel.setLayout(new BoxLayout(namePanel, BoxLayout.Y_AXIS));
+
+ // Set border to titled version
+ namePanel.setBorder(new TitledBorder(this.generateBorderTitle("name")));
+
+ // Get all genders
+ Gender[] genders = Gender.values();
+
+ // Init gender combo box
+ JComboBox<Gender> gender = new JComboBox<>(new DefaultComboBoxModel<>(genders));
+
+ // Panel for gender
+ JPanel gPanel = new JPanel();
+ gPanel.setLayout(new GridLayout(1, 2));
+
+ // Set tooltip text
+ gPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.gender.tooltipText"));
+
+ // Gender text field
+ JLabel gLabel = new JLabel(this.getBundle().getString("AddressbookFrame.gender.text"));
+
+ // Add both to gender panel
+ gPanel.add(gLabel);
+ gPanel.add(gender);
+
+ // Add gender panel to "name" panel
+ namePanel.add(gPanel);
+
+ // Panel for surname
+ JPanel sPanel = new JPanel();
+ sPanel.setLayout(new GridLayout(1, 2));
+
+ // Set too tip text
+ sPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.surname.tooltipText"));
+
+ // New label for surname is not needed
+ JLabel sLabel = new JLabel(this.getBundle().getString("AddressbookFrame.surname.text"));
+
+ // And input box
+ JTextField surname = new JTextField(20);
+
+ // Add both to surname panel
+ sPanel.add(sLabel);
+ sPanel.add(surname);
+
+ // Add surname panel to "name" panel
+ namePanel.add(sPanel);
+
+ // Panel for surname
+ JPanel fPanel = new JPanel();
+ fPanel.setLayout(new GridLayout(1, 2));
+
+ // Set too tip text
+ fPanel.setToolTipText(this.getBundle().getString("AddressbookFrame.familyName.tooltipText"));
+
+ // New label for surname is not needed
+ JLabel fLabel = new JLabel(this.getBundle().getString("AddressbookFrame.familyName.text"));
+
+ // And input box
+ JTextField familyName = new JTextField(20);
+
+ // Add both to surname panel
+ fPanel.add(fLabel);
+ fPanel.add(familyName);
+
+ // Add family namepanel to "name" panel
+ namePanel.add(fPanel);
+
+ // Finally add panel to dialog
+ this.addContact.add(namePanel);
+
+ // Only for developing:
+ /* DEBUG: */ this.addContact.setVisible(true);
+ }
+
/**
* Initialize other dialogs (e.g. "Add contact")
*/
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AddressbookFrame.menu.file.text=Datei
+AddressbookFrame.menu.addressbook.text=Adressbuch
AddressbookFrame.statusLabel.initializing.text=Initialisiere ...
AddressbookFrame.statusLabel.done.text=Fertig.
AddressbookFrame.statusLabel.shutdown.text=Shuttting down ...
AddressbookFrame.menuItem.exitProgram.toolTipText=Beendet das Programm und speichert alle Einstellungen ab.
AddressbookFrame.menuItem.exitProgram.text=Programm beenden
-AddressbookFrame.menu.addressbook.text=Adressbuch
AddressbookFrame.menuItem.addOwnData.text=Eigene Adresse hinzuf\u00fcgen
AddressbookFrame.menuItem.addOwnData.toolTipText=Erlaubt das Hinzuf\u00fcgen eigener Daten.
AddressbookFrame.menuItem.editOwnData.text=Eigene Adresse \u00e4ndern
AddressbookFrame.menuItem.editOwnData.toolTipText=Erlaubt das \u00c4ndern eigener Daten.
AddressbookFrame.dialog.addContact.title.text=Neue Adresse hinzuf\u00fcgen
AddressbookFrame.main.title.text=Adressen auflisten
-AddressbookFrame.border.name.title.text=Anrede, Vorname, Nachname
+AddressbookFrame.border.name.title.text=Anrede, Vorname, Nachname:
AddressbookFrame.gender.text=Anrede:
AddressbookFrame.gender.tooltipText=W\u00e4hlen Sie die Anrede aus.
AddressbookFrame.surname.text=Vorname:
AddressbookFrame.surname.tooltipText=Geben Sie den Vornamen ein.
+AddressbookFrame.familyName.text=Nachname:
+AddressbookFrame.familyName.tooltipText=Geben Sie den Nachnamen ein.
BaseContact.gender.unknown.text=Unbekannt
BaseContact.gender.male.text=Herr
BaseContact.gender.female.text=Frau
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AddressbookFrame.menu.file.text=File
+AddressbookFrame.menu.addressbook.text=Addressbook
AddressbookFrame.statusLabel.initializing.text=Initializing ...
AddressbookFrame.statusLabel.done.text=Done.
AddressbookFrame.statusLabel.shutdown.text=Shuttting down ...
AddressbookFrame.menuItem.exitProgram.toolTipText=Exits the program and saves all data.
AddressbookFrame.menuItem.exitProgram.text=Exit program
-AddressbookFrame.addressbookMenu.text=Addressbook
AddressbookFrame.menuItem.addOwnData.text=Add own address
AddressbookFrame.menuItem.addOwnData.toolTipText=Allows the user to add own address data
AddressbookFrame.menuItem.editOwnData.text=Edit own data
AddressbookFrame.menuItem.editOwnData.toolTipText=Allows the user to edit own address data
AddressbookFrame.dialog.addContact.title.text=Add new address
AddressbookFrame.main.title.text=List addresses
+AddressbookFrame.border.name.title.text=Gender, surname, family name:
AddressbookFrame.gender.text=Gender:
AddressbookFrame.gender.tooltipText=Choose gender.
AddressbookFrame.surname.text=Surname:
AddressbookFrame.surname.tooltipText=Enter surname.
+AddressbookFrame.familyName.text=Family name:
+AddressbookFrame.familyName.tooltipText=Enter family name.
BaseContact.gender.unknown.text=Unknown
BaseContact.gender.male.text=Mr.
BaseContact.gender.female.text=Mrs.