Discussion Locked

java applet

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi there.
Q) I am making a game of snake & ladder using Java applet.
For that i have made 100 button using swings numbering from 1-100.
Now i want to superimpose the images of snakes and ladder on the
button grid so that the images can run through the whole grid like
its done in html using filters.
How can i do that.
Please reply me at vipul_solanki@yahoo.com

5 replies

by vickydicky

Hi Vipul,
I took right disicion of using swing for ur game b'cuz it allows u to apply image on the button component.
Now what u have to do is either u hava to call the JButton coustructor which takes one parameter which is instance of ImageIcon or u can call setIcon() method on the button object by passing one parameter of type ImageIcon.
Hope that this will solve ur problem.

by cedric king

I am not very sure about that but if I were to do it, I would replace the image. A much simpler method but more tedious as you need to duplicate the images for Blank, Snake and the Ladder.

This discussion is closed to new replies.