Need Simple Java Apple... Help If You Know Java

Pojo

New member
I just need a very simple java applet for a site. I know a little bit about java but not enough to pull this off myself.

I need a random image pulling app... but...

the site has 3 different images that must all be pulled... each with its own link.. all the sizes are the same... all from the same directory...

so the app needs to be able to get 3 different images along with the links for those images... need to make sure that all images are uniqe so it would have to check if any are the same and pull another one if needed...

seems pretty simple... sort of like apple.com does with 4 images...
 
Actually, thinking about it, this could really be done easily in PHP. Tell me if you want me to work on one for you.
 
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "IMAGE #1"
images[2] = "IMAGE #2"
images[3] = "IMAGE #3"
images[4] = "IMAGE #4"
images[5] = "IMAGE #5"
var image = images[rand1]
// -- End Hiding Here -->
</script>


put this where you want your image to be

<script language="JavaScript">
<!-- Hide this script from old browsers --
document.write('<IMG SRC="' + image + '">')
// -- End Hiding Here -->
</script>










<applet code="ET_RandomImage.class" align="BASELINE" width="118" height="94">
<!--The images.-->
<param name="B-1-Image" value="image/java3-41.jpg">
<param name="B-2-Image" value="image/java3-42.jpg">
<param name="B-3-Image" value="image/java3-43.jpg">
<!--The links.-->
<param name="B-1-URL" value="http://www.shinbiro.com/@webker/">
<param name="B-2-URL" value="http://www.shinbiro.com/@webker/font/index.html">
<param name="B-3-URL" value="http://cecc-1.gsnu.ac.kr/~gscivil/">
<!--New default values.-->
<param name="B-d-URLFrame" value="_self">
<param name="B-d-URLText" value="Click on the image.">
<!--White background.-->
<param name="BGColor" value="ffffff">
</applet>









<script language="JavaScript">
<!--
/*
Random Image Link Script
*/

function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="img1.gif"
myimages[2]="img2.gif"
myimages[3]="img3.gif"

//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.wsabstract.com"
imagelinks[2]="http://www.dynamicdrive.com"
imagelinks[3]="http://www.java-scripts.net"

var ry=Math.floor(Math.random()*myimages.length)

if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}

random_imglink()
//-->
</script>
 
Back
Top