This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
connect-four/src/de/itsblue/ConnectFour/Plate.java

38 lines
632 B
Java
Raw Normal View History

2020-02-05 15:01:40 +01:00
package de.itsblue.ConnectFour;
import javax.swing.JPanel;
2020-02-05 15:29:52 +01:00
import java.awt.Color;
import java.awt.Dimension;
2020-02-05 15:01:40 +01:00
public class Plate extends JPanel {
/**
*
*/
private static final long serialVersionUID = 1L;
2020-02-05 15:29:52 +01:00
enum PlateType {
X, O
}
private PlateType type;
Plate(PlateType type) {
this.setType(type);
this.setPreferredSize(new Dimension(10, 10));
this.setBackground(this.type == PlateType.X ? Color.RED:Color.BLACK);
}
public PlateType getType() {
return type;
}
private void setType(PlateType type) {
this.type = type;
2020-02-05 15:01:40 +01:00
}
}