Browse Source

Improves Text in SmartDevice Creation PopUp on Linux machines

Andreas T. Meyer-Berg 5 years ago
parent
commit
9afa2367a5

+ 11 - 7
src/main/java/de/tu_darmstadt/tk/SmartHomeNetworkSim/view/popups/SmartDeviceCreationPopUp.java

@@ -11,6 +11,7 @@ import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
 import javax.swing.JTextField;
+import javax.swing.SwingConstants;
 
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
 import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
@@ -111,12 +112,13 @@ public class SmartDeviceCreationPopUp extends JDialog {
 		panelGeneral.setLayout(null);
 
 		JLabel lblName = new JLabel("Name:");
-		lblName.setBounds(0, 3, 38, 16);
+		lblName.setBounds(10, 3, 230, 16);
 		lblName.setToolTipText("Change the name of the SmartDevice");
+		lblName.setHorizontalAlignment(SwingConstants.RIGHT);
 		panelGeneral.add(lblName);
 
 		tfName = new JTextField();
-		tfName.setBounds(370, 0, 226, 22);
+		tfName.setBounds(250, 0, 226, 22);
 		tfName.setToolTipText("Enter the SmartDevice name");
 		panelGeneral.add(tfName);
 		tfName.setColumns(20);
@@ -124,12 +126,13 @@ public class SmartDeviceCreationPopUp extends JDialog {
 
 		JLabel lblXposition = new JLabel(
 				"x-position in [" + visualisationRadius + "," + (maxX - visualisationRadius) + "]:");
-		lblXposition.setBounds(0, 30, 106, 16);
+		lblXposition.setBounds(10, 30, 230, 16);
 		lblXposition.setToolTipText("Set the x position, which should be an integer in the given interval.");
+		lblXposition.setHorizontalAlignment(SwingConstants.RIGHT);
 		panelGeneral.add(lblXposition);
 
 		tfXposition = new JTextField();
-		tfXposition.setBounds(370, 27, 116, 22);
+		tfXposition.setBounds(250, 27, 116, 22);
 		lblXposition.setToolTipText("Enter the x position, which should be an integer in the given interval.");
 		panelGeneral.add(tfXposition);
 		tfXposition.setColumns(10);
@@ -138,12 +141,13 @@ public class SmartDeviceCreationPopUp extends JDialog {
 
 		JLabel lblYposition = new JLabel(
 				"y-position in [" + visualisationRadius + "," + (maxY - visualisationRadius) + "]:");
-		lblYposition.setBounds(0, 57, 106, 16);
-		lblXposition.setToolTipText("Set the y position, which should be an integer in the given interval.");
+		lblYposition.setBounds(10, 57, 230, 16);
+		lblYposition.setToolTipText("Set the y position, which should be an integer in the given interval.");
+		lblYposition.setHorizontalAlignment(SwingConstants.RIGHT);
 		panelGeneral.add(lblYposition);
 
 		tfYposition = new JTextField();
-		tfYposition.setBounds(370, 54, 116, 22);
+		tfYposition.setBounds(250, 54, 116, 22);
 		tfYposition.setToolTipText("Set the y position, which should be an integer in the given interval.");
 		panelGeneral.add(tfYposition);
 		tfYposition.setColumns(10);