|
@@ -12,6 +12,7 @@ import javax.swing.JPanel;
|
|
|
import javax.swing.JTabbedPane;
|
|
|
import javax.swing.JTextField;
|
|
|
import javax.swing.SwingConstants;
|
|
|
+import javax.swing.SwingUtilities;
|
|
|
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.control.Controller;
|
|
|
import de.tu_darmstadt.tk.SmartHomeNetworkSim.core.SmartDevice;
|
|
@@ -238,7 +239,17 @@ public class SmartDeviceCreationPopUp extends JDialog {
|
|
|
tabbedPane.setSelectedIndex(0);
|
|
|
refreshGUI();
|
|
|
}
|
|
|
-
|
|
|
+ /**
|
|
|
+ * Sets focus to the name text field
|
|
|
+ */
|
|
|
+ public void setNameFocus(){
|
|
|
+ tfName.setFocusable(true);
|
|
|
+ SwingUtilities.invokeLater(new Runnable() {
|
|
|
+ public void run() {
|
|
|
+ tfName.requestFocusInWindow();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
/**
|
|
|
* Validate the input Fields, and add the new SmartDevice to the model and
|
|
|
* panel
|