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.
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.