Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void actionPerformed(ActionEvent e) {
- System.out.println("Working");
- for (int x = 0; x < 10; x++) {
- for (int y = 0; y < 10; y++) {
- if (e.getSource() == imageParts[x][y]) {
- System.out.println("Pressed" + x + "" + y);
- if (grid.grid[x][y] == false) {
- grid.grid[x][y] = true;
- btn.setBackground(Color.black);
- } else {
- grid.grid[x][y] = false;
- btn.setBackground(Color.white);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment