Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package sudoku;
  7.  
  8. import java.awt.event.ActionEvent;
  9. import java.awt.event.ActionListener;
  10.  
  11. /**
  12. *
  13. * @author lucas.hu
  14. */
  15. public class TileClickHandler implements ActionListener{
  16. Sudoku game;
  17.  
  18. public TileClickHandler(Sudoku game) {
  19. this.game = game;
  20. }
  21.  
  22.  
  23. @Override
  24. public void actionPerformed(ActionEvent ae) {
  25. // actionPerformed is abstract (has no code)
  26. // in ActionListener so we HAVE to override it
  27.  
  28. // Get the source of the event and
  29. // cast it to a Button type so we
  30. // can access our Button methods
  31. Button b = (Button)ae.getSource();
  32. b.setValue(9);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement