Thread View: fr.comp.lang.java
3 messages
3 total messages
Started by Laurent Souriau
Mon, 27 Mar 2000 00:00
Reference to an Applet ?
Author: Laurent Souriau
Date: Mon, 27 Mar 2000 00:00
Date: Mon, 27 Mar 2000 00:00
15 lines
1193 bytes
1193 bytes
hi, I have a simple question. I create an applet which contains a method called Montredoc(). In the init method i create some objects. Inside one of these objects, i want to call Montredoc() but i don't know how to refer to my applet since there is no explicit way to give a name to my applet. any one has got an idea ? Thank you Laurent email: lsouriau@club-internet.fr
Re: Reference to an Applet ?
Author: A.Sudhir
Date: Mon, 27 Mar 2000 00:00
Date: Mon, 27 Mar 2000 00:00
56 lines
2182 bytes
2182 bytes
Hi,
Actually you can access your Applet. Here is the complete Applet Tag.
< APPLET
[CODEBASE = codebaseURL]
CODE = appletFile
[ALT = alternateText]
[NAME = appletInstanceName]
WIDTH = pixels
HEIGHT = pixels
[ALIGN = alignment]
[VSPACE = pixels]
[HSPACE = pixels]
>
[< PARAM NAME = appletParameter1 VALUE = value >]
[< PARAM NAME = appletParameter2 VALUE = value >]
. . .
[alternateHTML]
</APPLET>
Next using getAppletContext() get the Applet Context and then call the
method getApplet(string appletname) to ge access to that particular applet.
The Applet Name specified here is the name given in the Applet Tag. Hope
this helps.
Thanks
Sudhir
sudhir@javacommerce.com
http://www.javacommerce.com
--
Sudhir Ancha
MCI WorldCom
Phone : 703-918-6874
email : sudhir.ancha@wcom.com
Laurent Souriau <lsouriau@club-internet.fr> wrote in message
news:8bo0k5$fe2$1@news5.isdnet.net...
> hi,
>
> I have a simple question.
> I create an applet which contains a method called Montredoc().
> In the init method i create some objects.
> Inside one of these objects, i want to call Montredoc() but i don't
> know how to refer to my applet since there is no explicit way to
> give a name to my applet.
>
> any one has got an idea ?
>
> Thank you
>
> Laurent
> email: lsouriau@club-internet.fr
>
>
Re: Reference to an Applet ?
Author: Daniel
Date: Mon, 27 Mar 2000 00:00
Date: Mon, 27 Mar 2000 00:00
41 lines
1873 bytes
1873 bytes
Pass the applet to one of those objects that needs to access
Montredoc(). Make sure that Montredoc() is public so it can be accessed.
For example, if you want objectX to access Montredoc():
In the applet:
public void init()
{
ObjectX objectX = new ObjectX(this); // "this" means your passing in
this applet to objectX's constructor
}
Then, in the constructor of class ObjectX:
public ObjectX(Applet applet)
{
applet.Montredoc(); // here you call method in applet
}
Got it?
Laurent Souriau wrote:
> hi,
>
> I have a simple question.
> I create an applet which contains a method called Montredoc().
> In the init method i create some objects.
> Inside one of these objects, i want to call Montredoc() but i don't
> know how to refer to my applet since there is no explicit way to
> give a name to my applet.
>
> any one has got an idea ?
>
> Thank you
>
> Laurent
> email: lsouriau@club-internet.fr
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads