⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 completedpool.java

📁 小游戏一个 蜘蛛纸牌
💻 JAVA
字号:
package dujid.araneid;

import javax.swing.*;
import java.awt.*;
import java.util.Iterator;
import java.util.Stack;

public class CompletedPool extends JPanel {
	//private int cardWidth = 71;
	//private int cardHeight = 96;
	private int cardSpace = 10;
	Stack cards = new Stack();
	private Araneid main;

	public CompletedPool(Araneid main) {
		super();
		this.main = main;
	}

	public void putCompleted(Card card) {
		if (card!=null) 
		{
			this.cards.push(card);
		}
	}

	public void paintComponent(Graphics g) 
		{
			Graphics2D comp = (Graphics2D)g;
			comp.setColor(main.backgroundcolor);
			comp.fillRect(0,0,this.getSize().width,this.getSize().height);

			Iterator cardlist = (Iterator)cards.iterator();
			int x=0;
			while(cardlist.hasNext()) 
			{
				Card card = (Card)cardlist.next();
				comp.drawImage(card.getCurrent(),x,0,this);
				x+=this.cardSpace;
			}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -