Hey Guys,
I am working on a BlackJack GUI, I have just about everything set up, and now I am working on generating the cards.
I was doing some quick snippet test, to see if I can get it working. But no luck, I wanted to know if I can get some advice on this subject.
Like which Image Class to use.
public void createDealer()
{
JPanel dealerPanel = new JPanel();
dealerPanel.setLayout(new GridLayout());
Image backCard = new Image();
JLabel dealerName = new JLabel("Dealer");
JLabel potAmt = new JLabel("Pot Amount: ");
dealerPanel.add(dealerName);
dealerPanel.add(potAmt);
}
This is what I am trying to do.
This Card here:
http://upload.wikimedia.org/wikipedia/commons/d/d3/Poker-sm-221-Ah.png
I would call it AH.jpg
I read the Java api, and I just dont know how to add it as an image, and then added it to the dealerPanel(or PlayerPanel), casting an image as a component seemed strange. I dont even know if that method would work.
Any tips towards the correct direction would be great.