-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTile.java
More file actions
36 lines (24 loc) · 674 Bytes
/
Tile.java
File metadata and controls
36 lines (24 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import javax.swing.*;
import java.awt.*;
public abstract class Tile extends JPanel {
public Tile(int x, int y) {
this.xCoord = x;
this.yCoord = y;
this.setBackground(Color.lightGray);
this.setBorder(BorderFactory.createLineBorder(Color.black));
}
public Tile(int x, int y, Color c) {
this.xCoord = x;
this.yCoord = y;
this.setBackground(c);
this.setBorder(BorderFactory.createLineBorder(Color.black));
}
private final int xCoord;
private final int yCoord;
public int getXCoord() {
return xCoord;
}
public int getYCoord() {
return yCoord;
}
}