Click to See Complete Forum and Search --> : dynamic image change in an applet


webmark
02-26-2003, 12:39 AM
how do i dynamically change an image in a java applet?

<applet archive="zoompan.jar" code="zoompan.class" width="220" height="280">
<param name="image" value="hanger.jpg">
<param name="name" value="hanger">
<param name="autodesign" value="NO">
<param name="zoomspeed" value="30">
<param name="xmovespeed" value="2">
<param name="ymovespeed" value="1">
<param name="xborder" value="80">
<param name="yborder" value="100">
<param name="maxzoom" value="2">

<param name="priority" value="3">
<param name="MinSYNC" value="10">
Sorry, your browser doesn't support Java
</applet>


before i used the applet, i have this javascript and it works perfectly fine for plane images

<script language="JavaScript" type="text/JavaScript">
<!--
function imgswap(name, color)
{
eval("document." + name + ".src = 'products/" + name + color + ".jpg'");
}
//-->
</script>
how do i integrate this two??

any help will be very much appreciated

khalidali63
02-26-2003, 03:40 AM
As you can see you have a function (in javascript) that does the swapping,on the same basis you have to have a function in java applet that will react to a moueover /mouseclick events and swap the image.
The applet code you posted above merely displays the initial parameters for this applet.

Cheers

Khalid