package example10_1_BlocksMania; import javax.swing.JButton; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * Class to describe a button used in the Barnyard Simon game. The class manages * the button along with its color and sound. * @author yoder * @version 2010-01-10 * @created 15-Jan-2014 6:47:12 PM */ public class Tile extends JButton { private Position position; private char tileType; public char getTileType() { return tileType; } private void setTileType(char c) { tileType = c; setText(tileType+""); } public Tile(char tileType) { setTileType(tileType); addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { setTileType('#'); } }); } }