|
@@ -7,10 +7,17 @@ import javax.swing.JButton;
|
|
|
import javax.swing.JDialog;
|
|
|
import javax.swing.JPanel;
|
|
|
import javax.swing.border.EmptyBorder;
|
|
|
+import javax.swing.JLabel;
|
|
|
+import javax.swing.JTextField;
|
|
|
+import javax.swing.JComboBox;
|
|
|
+import javax.swing.DefaultComboBoxModel;
|
|
|
|
|
|
public class AddElementPopUp extends JDialog {
|
|
|
|
|
|
private final JPanel contentPanel = new JPanel();
|
|
|
+ private JTextField textField;
|
|
|
+ private JTextField textField_1;
|
|
|
+ private JTextField textField_2;
|
|
|
|
|
|
/**
|
|
|
* Launch the application.
|
|
@@ -29,11 +36,44 @@ public class AddElementPopUp extends JDialog {
|
|
|
* Create the dialog.
|
|
|
*/
|
|
|
public AddElementPopUp() {
|
|
|
- setBounds(100, 100, 450, 300);
|
|
|
+ setBounds(100, 100, 300, 190);
|
|
|
getContentPane().setLayout(new BorderLayout());
|
|
|
- contentPanel.setLayout(new FlowLayout());
|
|
|
contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
|
getContentPane().add(contentPanel, BorderLayout.CENTER);
|
|
|
+ contentPanel.setLayout(null);
|
|
|
+ this.setTitle("Add default Element to Object");
|
|
|
+
|
|
|
+ JLabel lblElementName = new JLabel("Element Name:");
|
|
|
+ lblElementName.setBounds(10, 11, 79, 14);
|
|
|
+ contentPanel.add(lblElementName);
|
|
|
+
|
|
|
+ JLabel lblProvidedEnergy = new JLabel("Provided Energy:");
|
|
|
+ lblProvidedEnergy.setBounds(10, 49, 90, 14);
|
|
|
+ contentPanel.add(lblProvidedEnergy);
|
|
|
+
|
|
|
+ JLabel lblAmount = new JLabel("Amount:");
|
|
|
+ lblAmount.setBounds(10, 84, 46, 14);
|
|
|
+ contentPanel.add(lblAmount);
|
|
|
+
|
|
|
+ textField = new JTextField();
|
|
|
+ textField.setBounds(140, 8, 110, 20);
|
|
|
+ contentPanel.add(textField);
|
|
|
+ textField.setColumns(10);
|
|
|
+
|
|
|
+ JComboBox comboBox = new JComboBox();
|
|
|
+ comboBox.setModel(new DefaultComboBoxModel(new String[] {"+", "-"}));
|
|
|
+ comboBox.setBounds(100, 46, 33, 20);
|
|
|
+ contentPanel.add(comboBox);
|
|
|
+
|
|
|
+ textField_1 = new JTextField();
|
|
|
+ textField_1.setBounds(140, 46, 110, 20);
|
|
|
+ contentPanel.add(textField_1);
|
|
|
+ textField_1.setColumns(10);
|
|
|
+
|
|
|
+ textField_2 = new JTextField();
|
|
|
+ textField_2.setBounds(140, 81, 110, 20);
|
|
|
+ contentPanel.add(textField_2);
|
|
|
+ textField_2.setColumns(10);
|
|
|
{
|
|
|
JPanel buttonPane = new JPanel();
|
|
|
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
|
|
@@ -51,5 +91,4 @@ public class AddElementPopUp extends JDialog {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|