|
@ -13,20 +13,25 @@ public class StartStack extends JPanel { |
|
|
private Image im; |
|
|
private Image im; |
|
|
private ArrayList<Card> stack = new ArrayList<Card>(); |
|
|
private ArrayList<Card> stack = new ArrayList<Card>(); |
|
|
|
|
|
|
|
|
|
|
|
private int offset; |
|
|
|
|
|
|
|
|
public StartStack(int _x, int _y) { |
|
|
public StartStack(int _x, int _y) { |
|
|
super.setLocation(_x, _y); |
|
|
super.setLocation(_x, _y); |
|
|
super.setSize(72, 450); |
|
|
super.setSize(72, 450); |
|
|
super.setOpaque(false); |
|
|
super.setOpaque(false); |
|
|
super.setLayout(null); |
|
|
super.setLayout(null); |
|
|
|
|
|
|
|
|
|
|
|
offset = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void addCard(Card _card) { |
|
|
public void addCard(Card _card) { |
|
|
|
|
|
_card.setLocation(0, offset); |
|
|
stack.add(_card); |
|
|
stack.add(_card); |
|
|
System.out.println("dfsfdsf"); |
|
|
|
|
|
addtoPanel(); |
|
|
addtoPanel(); |
|
|
|
|
|
offset += 20; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void addtoPanel() { |
|
|
|
|
|
|
|
|
private void addtoPanel() { |
|
|
|
|
|
|
|
|
this.removeAll(); |
|
|
this.removeAll(); |
|
|
for(int i = stack.size()-1; i>=0; i-- ) { |
|
|
for(int i = stack.size()-1; i>=0; i-- ) { |
|
|