- repainting automatically now

This commit is contained in:
Dorian Zedler 2020-02-22 10:41:16 +01:00
parent 974c8864b6
commit 2d6a7f8dce

View file

@ -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());