Browse Source

init startStack

feature_solitaer_StartStack
Alexander Hartung 3 years ago
parent
commit
d629613db4
  1. 2
      src/main/java/solitaer/SolitaerGamePanel.java
  2. 34
      src/main/java/solitaer/StartStack.java
  3. BIN
      src/main/java/solitaer/images/back.png

2
src/main/java/solitaer/SolitaerGamePanel.java

@ -15,6 +15,8 @@ public class SolitaerGamePanel extends JPanel {
public SolitaerGamePanel() {
setLayout(null);
StartStack a = new StartStack(25,25);
this.add(a);
}

34
src/main/java/solitaer/StartStack.java

@ -0,0 +1,34 @@
package solitaer;
import java.awt.Graphics;
import java.awt.Image;
import java.util.ArrayList;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class StartStack extends JPanel {
private static final long serialVersionUID = 1L;
private Image im;
private ArrayList<Card> Stack = new ArrayList<Card>();
public StartStack(int _x, int _y) {
super.setLocation(_x, _y);
super.setSize(72,450);
super.setOpaque(false);
super.setLayout(null);
}
@Override
protected void paintComponent(Graphics g) {
// TODO Auto-generated method stub
super.paintComponent(g);
ImageIcon ii = new ImageIcon(getClass().getResource("images/back.png"));
im = ii.getImage();
g.drawImage(im, 0, 0, this.getWidth(), 96, this);
}
}

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

After

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

Loading…
Cancel
Save