i answered the question over on codeguru...did it not help at all? the reason it won't work is because you're telling java to make a hand equal to a card, which makes no sense. instead you need to make java add a card to the hand by giving Hand a setCard method.
Yes your message did help but i posted to both sites on same day so i didn't get your one til after i posted both.
I have decided to start again. I have attatched my new version.
instead of creating the object card straight away i decided to make thwe structure surrounding an index number.
public int [][]Hand;
public int [] Deck;
means that when i shuffle the deck i get 52 random numbers which when put into a hand, corresponds to a picture card ( 1.Gif, 2.Gif, 3.Gif etc).
The program works fine i can shuffle the deck deal a number to a player. But, i'm not sure how i go about the graphics structure.
i used
// ---------- Paint Card ----------------
public void paint ( Graphics g )
{
image = Toolkit.getDefaultToolkit
().getImage( "cards/" + (Hand[i][j]) + ".gif");
g.drawImage(Card, 100, 100, this );
}
but the picture only comes on screen when i minimise the window and get it back again, or when i goto another open program and then back again.
do i need an update() or something?
I am also having trouble understanding how i can go about keeping the card on screen and at the same time have the other cards over the top but slightly to the right to give the effect of a fanned hand.
Can you give me any hints on how to do this?
also i always get runtime error messages in dos.
sorry, i didn't realise they'd both been posted at once. Anyway, i posted an answer to your new question on the other forum. Hope it helps....but GUI's really aren't my thing hehe. Too arty for me so haven't had enough practice with them