From eab4aedc1d82d81354e5385f25b78b9a78526ffc Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Wed, 8 Apr 2015 21:53:18 +0200 Subject: [PATCH] Added text to button actions --- Applicatie/ControlPanel.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Applicatie/ControlPanel.java b/Applicatie/ControlPanel.java index 97d185c..46e349f 100644 --- a/Applicatie/ControlPanel.java +++ b/Applicatie/ControlPanel.java @@ -22,6 +22,7 @@ public class ControlPanel extends JPanel private int people; JLabel timeLabel; JLabel peopleLabel; + JLabel runningLabel; public ControlPanel() { @@ -51,6 +52,7 @@ public class ControlPanel extends JPanel public void actionPerformed(ActionEvent e) { p.getT().start(); + runningLabel.setText("Simulation Started"); } }); simulatorPanel.add(playButton); @@ -62,6 +64,7 @@ public class ControlPanel extends JPanel public void actionPerformed(ActionEvent e) { p.getT().stop(); + runningLabel.setText("Simulation Paused"); } }); simulatorPanel.add(pauseButton); @@ -73,6 +76,7 @@ public class ControlPanel extends JPanel public void actionPerformed(ActionEvent e) { p.getT().stop(); + runningLabel.setText("Simulation Stopped"); } }); simulatorPanel.add(stopButton); @@ -131,7 +135,7 @@ public class ControlPanel extends JPanel runningPanel.setMaximumSize(new Dimension(195,50)); add(runningPanel); { - JLabel runningLabel = new JLabel("Simulation stopped"); + runningLabel = new JLabel("Simulation stopped"); runningLabel.setFont(new Font("Segoe UI", Font.PLAIN, 20)); runningPanel.add(runningLabel); }