diff --git a/src/de/itsblue/ConnectFour/PlateContainer.java b/src/de/itsblue/ConnectFour/PlateContainer.java index 5403311..ed42768 100644 --- a/src/de/itsblue/ConnectFour/PlateContainer.java +++ b/src/de/itsblue/ConnectFour/PlateContainer.java @@ -64,6 +64,9 @@ public class PlateContainer extends JPanel { this.containedPlate = plate; + // repaint + this.paint(this.getGraphics()); + return true; } @@ -102,6 +105,9 @@ public class PlateContainer extends JPanel { this.highlighted = false; + // repaint + this.paint(this.getGraphics()); + return ret; } @@ -110,6 +116,9 @@ public class PlateContainer extends JPanel { */ public void highlight() { this.highlighted = true; + + // repaint + this.paint(this.getGraphics()); } /** @@ -117,6 +126,8 @@ public class PlateContainer extends JPanel { */ @Override public void paint(Graphics g) { + if(g == null) + return; // draw background g.setColor(Color.lightGray); g.fillRect(0, 0, this.getWidth(), this.getHeight());