/* Connect four - written in java Copyright (C) 2020 Oliver Schappacher and Dorian Zedler This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ package de.itsblue.ConnectFour; import javax.swing.JPanel; import java.awt.Color; import java.awt.Dimension; public class Plate extends JPanel { /** * */ private static final long serialVersionUID = 1L; enum PlateType { X, O } private PlateType type; Plate(PlateType type) { this.setType(type); this.setPreferredSize(new Dimension(20, 20)); this.setBackground(this.type == PlateType.X ? Color.RED:Color.BLACK); } public PlateType getType() { return type; } private void setType(PlateType type) { this.type = type; } }