diff options
Diffstat (limited to 'PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java')
-rw-r--r-- | PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java index 188b262..7ba2200 100644 --- a/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java +++ b/PunchingBag/src/uk/ac/open/punchingbag/examples/SimpleKeyboard.java @@ -1,5 +1,6 @@ package uk.ac.open.punchingbag.examples; +import java.awt.Color; import java.io.File; import java.io.IOException; @@ -36,23 +37,24 @@ public class SimpleKeyboard implements ButtonListener { } public void buttonPressed(int x, int y) { + System.out.println("Button Pressed: " + x + " " + y); if (y < 3) { - bag.fillRect(0, 0, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 0, 9, 4, Color.red, 500); playKey(5); } else if (y < 6) { - bag.fillRect(0, 3, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 3, 9, 4, Color.red, 500); playKey(4); } else if (y < 9) { - bag.fillRect(0, 6, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 6, 9, 4, Color.red, 500); playKey(3); } else if (y < 12) { - bag.fillRect(0, 9, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 9, 9, 4, Color.red, 500); playKey(2); } else if (y < 15) { - bag.fillRect(0, 12, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 12, 9, 4, Color.red, 500); playKey(1); } else { - bag.fillRect(0, 15, 9, 4, PunchingBag.Colour.Red, 500); + bag.fillRect(0, 15, 9, 4, Color.red, 500); playKey(0); } } |