[3265] in java-interest
Re: applet.name?
daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Sun Nov 5 18:01:10 1995
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: lemayp@lne.com (Laura Lemay, Killer of Trees)
Date: Sun, 5 Nov 1995 13:27:22 -0800 (PST)
Cc: java-interest@webrunner.neato.org (java)
In-Reply-To: <v02120d0aacc2c933f9fb@[140.174.94.4]> from "Laura Lemay, Killer of Trees" at Nov 5, 95 12:31:58 pm
Hi Laura,
> Applet communication. Using the NAME attribute in APPLET, you can assign an
> applet a name. Then, using getApplet(String), you can get ahold of
> a reference to that applet object. Neat.
>
> You can also use getApplets() to get all the currently running applets
> on the page, as an Enumeration object.
>
> Is there any way, given an applet object such as the one you get back
> from getApplets(), to find out the name of that applet? I was hoping
> there would be a name IV on applet that would tell me this, so I could
> do something like:
>
> for (Enumeration e = getAppletContext().getApplets(); e.hasMoreElements();) {
> Applet current = (Applet)(e.nextElement());
> System.out.println("Sending message to " + current.name);
> sendMessage(current);
> }
>
> Just curious.
You can call :
current.getParameter("name");
Have fun,
Arthur van Hoff (avh@eng.sun.com)
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com