Commit 5bf11b8e authored by Matthias Möller's avatar Matthias Möller

fixing some bugs in the GUI

parent 80890ac9
No preview for this file type
......@@ -31,6 +31,7 @@ public class EmotivGUI extends JFrame implements ActionListener{
private JLabel maxBatteryLabel = new JLabel("");
private JLabel trainingStateLabel = new JLabel();
private JPanel buttonPanel = new JPanel();
private JPanel trainingPanel = new JPanel();
private JPanel websocketPanel = new JPanel();
private JSlider MCPUSHSlider;
private JSlider MCPULLSlider;
......@@ -50,8 +51,10 @@ public class EmotivGUI extends JFrame implements ActionListener{
this.contentPanel = new JPanel(new FlowLayout(0,10,10));
this.contentPanel.setPreferredSize(new Dimension(500, 110));
this.add(contentPanel);
this.createTrainingContent();
this.createTrainingPanel();
this.createWebsocketConnectionPanel();
this.showTrainingPanel();
this.setSize(500, 220);
......@@ -91,10 +94,10 @@ public class EmotivGUI extends JFrame implements ActionListener{
}
private void createTrainingContent() {
private void showTrainingPanel() {
this.contentPanel.removeAll();
this.createTrainingControlPanel();
this.createTrainingWorkPanel();
this.contentPanel.updateUI();
this.contentPanel.add(this.trainingPanel);
}
private void createMenuPanel() {
......@@ -112,6 +115,11 @@ public class EmotivGUI extends JFrame implements ActionListener{
}
private void createTrainingPanel() {
this.createTrainingControlPanel();
this.createTrainingWorkPanel();
}
private void createTrainingControlPanel() {
Dimension buttonSize = new Dimension(140, 25);
JPanel jPanel2 = new JPanel();
......@@ -132,7 +140,7 @@ public class EmotivGUI extends JFrame implements ActionListener{
jPanel2.add(jButton2);
jPanel2.add(jButton3);
jPanel2.setPreferredSize(new Dimension(140, 110));
this.contentPanel.add(jPanel2);
this.trainingPanel.add(jPanel2);
}
private void createTrainingWorkPanel() {
......@@ -173,7 +181,7 @@ public class EmotivGUI extends JFrame implements ActionListener{
this.buttonPanel.setVisible(false);
jPanel.add(buttonPanel);
this.contentPanel.add(jPanel);
this.trainingPanel.add(jPanel);
}
......@@ -308,7 +316,7 @@ public class EmotivGUI extends JFrame implements ActionListener{
}
else if(buttonName=="Training") {
this.createTrainingContent();
this.showTrainingPanel();
}
else if(buttonName == "Verbindung") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment