Hi, I would like to display random images in a java applet i am doing. I have to create a card game called 'snap'. I would like 2 random cards to appear on the applet every time the 'Next' button is pressed which i will be creating.
This is the skeleton program i was given to start this program.,
import java.applet.*;
import java.awt.event.*;
import java.awt.*;
public class CardGame extends Applet implements ActionListener /*NB other interfaces may be added*/
{
int MAX= some_value;
MyObj myObjects[];
public void start()
{
myObjects=new MyObj[MAX];
//instantiate objects here
myObjects[0]=new MyObj(/*some_arguments*/);
}
public void actionPerformed(ActionEvent e)
{
}
public void paint(Graphics g)
{
}
}
class MyObj {
MyObj(/*some_arguments*/) {
}
}
Thanks.