diff options
Diffstat (limited to 'PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java')
-rw-r--r-- | PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java b/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java index 32ca78a..5eb57c6 100644 --- a/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java +++ b/PunchingBag/src/uk/ac/open/punchingbag/PunchingBagGUI.java @@ -291,13 +291,13 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, if (a.getActionCommand() == "C") { bag.clearLEDs(); } else { - PunchingBag.Colour colour = PunchingBag.Colour.None; + Color colour = Color.white; if (((JComboBox) a.getSource()).getSelectedIndex() == 1) { - colour = PunchingBag.Colour.Red; + colour = Color.red; } else if (((JComboBox) a.getSource()).getSelectedIndex() == 2) { - colour = PunchingBag.Colour.Yellow; + colour = Color.yellow; } else if (((JComboBox) a.getSource()).getSelectedIndex() == 3) { - colour = PunchingBag.Colour.Green; + colour = Color.green; } System.out.println("Setting " + a.getActionCommand().split(",")[0] + " " @@ -426,11 +426,11 @@ public class PunchingBagGUI implements MouseListener, MouseMotionListener, } public void paintComponent(Graphics g) { - if (bag.getLED(x, y) == PunchingBag.Colour.Red) { + if (bag.getLED(x, y) == Color.red) { g.setColor(Color.red); - } else if (bag.getLED(x, y) == PunchingBag.Colour.Green) { + } else if (bag.getLED(x, y) == Color.green) { g.setColor(Color.green); - } else if (bag.getLED(x, y) == PunchingBag.Colour.Yellow) { + } else if (bag.getLED(x, y) == Color.yellow) { g.setColor(Color.yellow); } else { g.setColor(Color.white); |