Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
524 B
1
Indexable
Never
import javax.swing.*;

public class Cards extends JPanel{

	//Declarations
	String suit;
	String rank;
	int numberOfCards;
	ImageIcon icon;
	
	// Cards constructor
	Cards(String suit, String rank, int numberOfCards, ImageIcon icon) { 
		this.suit = suit;
		this.rank = rank;
		this.numberOfCards = numberOfCards;
		this.icon = icon;
	}
	
	// When card is used, decrease "numberOfDecks" by 1
	public void useCard() {
		this.numberOfCards--;
	}
	/*
	public static JLabel getCardIcon() {
	    return new JLabel(icon);
	}
	*/
}
Leave a Comment