Is init() really only called once in an Applet's life.

A

Anthony

Hi,

I have some code which runs an Applet

the first one Graph extend Applet and runs init()

It also creates an instance of a 2nd class which has the run method in it
and handles mouse events.

this also creates an instance of the first Class.

So when the frist class is called from the 2nd class will init() be called
again ?
If not can parameters be pased into such as init(centre, node) ?

As you can tell me java newbie :)
 
R

Roedy Green

So when the frist class is called from the 2nd class will init() be called
again ?
If not can parameters be pased into such as init(centre, node) ?

The browser calls your init, start, stop and destroy methods of the
main Applet when interesting changes happen in the outside word, e.g.
the user browses to a new page.

The browser knows nothing of your other classes and hence nobody will
automatically call the init method of them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top