- repainting automatically now
This commit is contained in:
parent
974c8864b6
commit
2d6a7f8dce
1 changed files with 11 additions and 0 deletions
|
@ -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());
|
||||
|
|
Reference in a new issue