Calling applet from a java script

T

tomerdr

Hi,
I have an assignment in a java course in which i need to call an applet

from a java script.

The following is my script:


<applet name="MainApplet" id="MainApplet" code="MainApplet.class"
width="600" height="200" archive="MyApplets.jar">
<PARAM NAME="PictureFileName1" VALUE="Lilac.JPG">
<PARAM NAME="PictureFileName2" VALUE="Rose.JPG">
<PARAM NAME="RecipientName" VALUE="Juliet">
<PARAM NAME="SenderName" VALUE="Romeo">
<PARAM NAME="Greetings" VALUE="Happy birthday">
</applet>


<script language="JavaScript">
function UpdateAppletParams()
{
document.MainApplet.recipientName="test";
alert( document.MainApplet.recipientName);
document.MainApplet.repaint();


}


</script>

The following is part of my applet.it output a message on the screen
something like "hello [recipientName],[greetings], from
[senderName]..."


public class MainApplet extends java.applet.Applet {
public
Image image1;
Image image2;
String recipientName;
String senderName;
String greetings;
:
:
:


When calling the script and "debug" it with alert i can see that
document.MainApplet.recipientName='Test'
But the new message is not displayed.
i am running IE 7.0,XP PRO SP2,NETBEANS 5.5.


Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top