From 698569ba076d98eeadb6894a593b444f6064db59 Mon Sep 17 00:00:00 2001 From: Alexander Hartung Date: Sun, 30 Jan 2022 18:00:49 +0100 Subject: [PATCH] Add render for WasteStack --- src/main/java/solitaer/WasteStack.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/solitaer/WasteStack.java b/src/main/java/solitaer/WasteStack.java index 554a936..c86d360 100644 --- a/src/main/java/solitaer/WasteStack.java +++ b/src/main/java/solitaer/WasteStack.java @@ -1,5 +1,8 @@ package solitaer; +import java.awt.Color; +import java.awt.Graphics; + public class WasteStack extends BaseStack { private static final long serialVersionUID = 1L; @@ -17,5 +20,19 @@ public class WasteStack extends BaseStack { // TODO Auto-generated method stub return false; } + + @Override + protected void paintComponent(Graphics g) { + // TODO Auto-generated method stub + super.paintComponent(g); + if (stackIsEmpty()) { + g.setColor(Color.lightGray); + g.fillRect(0, 0, this.getWidth(), IMAGE_HIGHT); + + g.setColor(Color.black); + g.drawRect(0, 0, this.getWidth() - 1, IMAGE_HIGHT - 1); + + } + } }