I'm trying to make 3 random images gifs with one image having a string of text at the bottom. I need to make this in the applet class so I can't use the random class to simplify it.
The project also states that using the start () method will help as a random flag to determine which image is shown but I'm very confused on how I would write the statements.
here is the full text full the project to help clarify:
In your applet, randomly show an image when the applet is started or restarted. Also, print a message on the applet, depending on which image is shown. Hints: the start() method would be a good place to put some sort of random flag to determine which image should be shown. It is also a good place to call a separate method to set the image and message. The paint() method should only do the actual drawing of the image and the message. Separate methods can be created to set the image and the message into variables for the paint() method to use.
It appears you are not trying to make random .gifs, but select one of three randomly to display. I presume you know how to display a .gif on your applet with its paint() method, and how to select that .gif from a file?
Joined: Feb 27, 2012
Thank you! and yes, I do know how to display an image with the paint() method and how to select a file.