Skip to content
Snippets Groups Projects
Commit ec387f61 authored by joalhelk's avatar joalhelk
Browse files

fixed a bug on combobox

parent aec1826a
No related branches found
No related tags found
No related merge requests found
...@@ -49,9 +49,7 @@ public class WelcomePage implements MouseListener, ActionListener { ...@@ -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 NodeDataFrame nodeDataFrame = new NodeDataFrame(leftPanelWidth, topPanelHeight, width-leftPanelWidth, height-topPanelHeight-bottomPanelHeight);
private static NodeSettingsFrame nodeSettingFrame = new NodeSettingsFrame(width-leftPanelWidth, height-topPanelHeight-bottomPanelHeight); private static NodeSettingsFrame nodeSettingFrame = new NodeSettingsFrame(width-leftPanelWidth, height-topPanelHeight-bottomPanelHeight);
public WelcomePage(){ public WelcomePage(){
Nodes.updateNodes();
frame = new JFrame(); frame = new JFrame();
frame.getContentPane().setBackground( Color.MAGENTA ); frame.getContentPane().setBackground( Color.MAGENTA );
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
...@@ -66,18 +64,7 @@ public class WelcomePage implements MouseListener, ActionListener { ...@@ -66,18 +64,7 @@ public class WelcomePage implements MouseListener, ActionListener {
topPanel.setLayout(null); topPanel.setLayout(null);
frame.getContentPane().add(topPanel); frame.getContentPane().add(topPanel);
for(int i = 0; i < Nodes.size(); i++) { updateComboBox();
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);
}
comboBox.addActionListener(this); comboBox.addActionListener(this);
comboBox.setBounds(500, 10, 200, 50); comboBox.setBounds(500, 10, 200, 50);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment