diff --git a/WatcherGui/src/main/java/com/joelhelkala/watcherGui/frames/WelcomePage.java b/WatcherGui/src/main/java/com/joelhelkala/watcherGui/frames/WelcomePage.java index a6885d013d4b27d9bc63bfaa933736640fa521f1..fda5ae22d2684e705810776a078747bc8072ecd2 100644 --- a/WatcherGui/src/main/java/com/joelhelkala/watcherGui/frames/WelcomePage.java +++ b/WatcherGui/src/main/java/com/joelhelkala/watcherGui/frames/WelcomePage.java @@ -49,9 +49,7 @@ public class WelcomePage implements MouseListener, ActionListener { private static NodeDataFrame nodeDataFrame = new NodeDataFrame(leftPanelWidth, topPanelHeight, width-leftPanelWidth, height-topPanelHeight-bottomPanelHeight); private static NodeSettingsFrame nodeSettingFrame = new NodeSettingsFrame(width-leftPanelWidth, height-topPanelHeight-bottomPanelHeight); - public WelcomePage(){ - Nodes.updateNodes(); - + public WelcomePage(){ frame = new JFrame(); frame.getContentPane().setBackground( Color.MAGENTA ); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -66,18 +64,7 @@ public class WelcomePage implements MouseListener, ActionListener { topPanel.setLayout(null); frame.getContentPane().add(topPanel); - for(int i = 0; i < Nodes.size(); i++) { - comboBox.addItem(Nodes.get(i).getLocation()); - } - - String selected = (String) comboBox.getSelectedItem(); - Node node = Nodes.findByLocation(selected); - - if(node != null) { - node.updateData(HttpRequests.getNodeData(node.getId())); - nodeDataFrame.updateData(node); - nodeSettingFrame.updateInformation(node); - } + updateComboBox(); comboBox.addActionListener(this); comboBox.setBounds(500, 10, 200, 50);