Browse Source

add Image for empty stack

feature_solitaer_StartStack
Alexander Hartung 3 years ago
parent
commit
0fccd2aba9
  1. 3
      src/main/java/solitaer/SolitaerGamePanel.java
  2. 3
      src/main/java/solitaer/StartStack.java
  3. BIN
      src/main/java/solitaer/images/empty.png

3
src/main/java/solitaer/SolitaerGamePanel.java

@ -19,6 +19,9 @@ public class SolitaerGamePanel extends JPanel {
a.addCard(new Card(13, Symbol.Karo, true)); a.addCard(new Card(13, Symbol.Karo, true));
a.addCard(new Card(1, Symbol.Karo, true)); a.addCard(new Card(1, Symbol.Karo, true));
this.add(a); this.add(a);
StartStack b = new StartStack(200,25);
this.add(b);
} }

3
src/main/java/solitaer/StartStack.java

@ -35,7 +35,6 @@ public class StartStack extends JPanel {
this.removeAll(); this.removeAll();
for(int i = stack.size()-1; i>=0; i-- ) { for(int i = stack.size()-1; i>=0; i-- ) {
System.out.println("for");
this.add(stack.get(i)); this.add(stack.get(i));
} }
} }
@ -45,7 +44,7 @@ public class StartStack extends JPanel {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.paintComponent(g); super.paintComponent(g);
if (stack.size() == 0) { if (stack.size() == 0) {
ImageIcon ii = new ImageIcon(getClass().getResource("images/back.png"));
ImageIcon ii = new ImageIcon(getClass().getResource("images/empty.png"));
im = ii.getImage(); im = ii.getImage();
g.drawImage(im, 0, 0, this.getWidth(), 96, this); g.drawImage(im, 0, 0, this.getWidth(), 96, this);
} }

BIN
src/main/java/solitaer/images/empty.png

After

Width: 73  |  Height: 97  |  Size: 6.9 KiB

Loading…
Cancel
Save