neta
asked on
Need example of getAppletContext with AWT applet !!
Can anyone please post a simple code
which will explain to me
how sohuld i use the getAppletContext
interface.
Regards
Neta :}
which will explain to me
how sohuld i use the getAppletContext
interface.
Regards
Neta :}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi neta,
Above both comments are fine. Thye explained to show a document. I am explaining Applet-Applet communication.
getAppletContext() will be useful for getting applet-applet communication which are resinding on same web page.
AppletContext ac = getAppletContext();
ac.getApplet("anotherapple tname"); returns a applet for which the "anotherappletname" string is given by browser.
In that case you have to chage applet tag as follows
<Applet code="somex.class" height=200 width=200 name="somename"></applet>
for each applet which is residing on same web page, give a name and you can use that name in appletcontext's getApplet()
method
after this you can call methods of someotherapplets.
Best of luck
Above both comments are fine. Thye explained to show a document. I am explaining Applet-Applet communication.
getAppletContext() will be useful for getting applet-applet communication which are resinding on same web page.
AppletContext ac = getAppletContext();
ac.getApplet("anotherapple
In that case you have to chage applet tag as follows
<Applet code="somex.class" height=200 width=200 name="somename"></applet>
for each applet which is residing on same web page, give a name and you can use that name in appletcontext's getApplet()
method
after this you can call methods of someotherapplets.
Best of luck
ASKER
Thank you all
you have help me alot
keep on the good job
regards
Neta :}
you have help me alot
keep on the good job
regards
Neta :}
neta,
An applet runs inside a browers such as Netscape, IE or appletviewer. An applet can ask the browser to do things for it, for example to fetcht an audio clip, show a short messages in the status line, show a different web page and etc. If you use applet viewer for certain task above, it won't work.
To communicate with the browsers, an applet call the getAppletContext mehtod. The method returns an object of type AppletContext.
for example :
to show different webpage
URL u = new URL ("http://binus.ac.id");
getAppletContext().showDoc
hope this helps
danny