Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package sudoku;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- /**
- *
- * @author lucas.hu
- */
- public class TileClickHandler implements ActionListener{
- Sudoku game;
- public TileClickHandler(Sudoku game) {
- this.game = game;
- }
- @Override
- public void actionPerformed(ActionEvent ae) {
- // actionPerformed is abstract (has no code)
- // in ActionListener so we HAVE to override it
- // Get the source of the event and
- // cast it to a Button type so we
- // can access our Button methods
- Button b = (Button)ae.getSource();
- b.setValue(9);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement