Article View: fr.comp.lang.java
Article #4Re: Reference to an Applet ?
From: 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
Technical Details
Message-ID:
<38DF90FC.D220EDF6@amazingmedia.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8bo0k5$fe2$1@news5.isdnet.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f631b,23f29b2e2953c63e X-Google-Attributes: gidf631b,public X-Google-Thread: 10a146,23f29b2e2953c63e X-Google-Attributes: gid10a146,public X-Google-Thread: f74b3,23f29b2e2953c63e X-Google-Attributes: gidf74b3,public From: Daniel <daniel@amazingmedia.com> Subject: Re: Reference to an Applet ? Date: 2000/03/27 Message-ID: <38DF90FC.D220EDF6@amazingmedia.com> X-Deja-AN: 603010268 Content-Transfer-Encoding: 7bit References: <8bo0k5$fe2$1@news5.isdnet.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 954175708 192.245.235.42 (Mon, 27 Mar 2000 16:48:28 GMT) Organization: Verio MIME-Version: 1.0 NNTP-Posting-Date: Mon, 27 Mar 2000 16:48:28 GMT Newsgroups: fr.comp.lang.java,comp.lang.java.programmer,borland.public.jbuilder.java.language