Get best price on Unlocked Moto G Power | ||||||||||||
|
||||||||||||
|
Java Applet: Display Random Image (Motate Applet)This simple applet randomly displays one of four images when the page is loaded. Each image has a link defined for it. It
could serve up ads, for example.
This is just an example, Shift+Reload to see image change. Because I am the one using this, I did not plan for any errors when entering the parameters. I couple of trys and catches should be used to insure the links and images are actually there. Also, a double buffering technique could be used to display the image completely, instead of having the image show as it is loaded. Because it only loads one image, I thought this was not necessary. Get the Source Code (motate.java.txt) Here is the HTML part: <applet code="Motate.class" codebase="classes/" width="336" height="138">
<param name="image1" value="quote1.gif"> <param name="url1" value="http://www.amusing.com/index.php"> <param name="image2" value="quote2.gif"> <param name="url2" value="http://www.crochetkitty.com/index.php"> <param name="image3" value="quote3.gif"> <param name="url3" value="http://www.seatmate.com/index.php"> <param name="image4" value="quote4.gif"> <param name="url4" value="http://www.amusing.com/admiral/index.php"> <param name="n" value="4"> <p><hr><br /><b>Java Applet Not Shown.<br />Your browser is not enabled to display Java Applets.</b><br /><hr></p> </applet>
|
privacy policy || © 1997-2016. astonishinc.com All Rights Reserved. |