import java.awt.Color; import java.awt.Font; import java.awt.Graphics; public class Tile extends Light { private int row, column, digit; private Font font; public Tile(int x, int y, int size) { super(x,y,size); row = -1; column = -1; setDigit(1 + (int)(9*Math.random())); font = new Font ("Helvetica", Font.BOLD , 35); } public void draw(Graphics g) { super.draw(g); g.setFont(font); int x = getX(); int y = getY(); int s = super.getSize(); g.setColor(Color.YELLOW); g.drawString(""+digit, x+s/3, y+3*s/4); } public int getRow() { return row; } public void setRow(int row) { this.row = row; } public int getColumn() { return column; } public void setColumn(int column) { this.column = column; } public int getDigit() { return digit; } public void setDigit(int digit) { this.digit = digit; } }