Untitled
unknown
plain_text
2 years ago
524 B
3
Indexable
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); } */ }
Editor is loading...
Leave a Comment