|
@@ -148,8 +148,17 @@ public class AddElementPopUp extends JDialog {
|
|
|
} else {
|
|
|
// JOptionPane.showMessageDialog(new JFrame(),
|
|
|
// "Please enter a Name");
|
|
|
+
|
|
|
+ if (elementName.getText().length() == 0) {
|
|
|
+ JLabel errorString = new JLabel("No name");
|
|
|
+ errorString.setBounds(200, 8, 200, 20);
|
|
|
+ contentPanel.add(errorString);
|
|
|
+ } else if (repeated) {
|
|
|
+ JLabel errorString = new JLabel("Name already given");
|
|
|
+ errorString.setBounds(240, 8, 100, 20);
|
|
|
+ contentPanel.add(errorString);
|
|
|
+ }
|
|
|
elementName.setBackground(new Color(255, 50, 50));
|
|
|
- // Jlabel repeatedString = new JLabel();
|
|
|
}
|
|
|
}
|
|
|
});
|