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

Discussion in 'Java' started by Anthony, Jun 5, 2004.

  1. Anthony

    Anthony Guest

    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 :)
    Anthony, Jun 5, 2004
    #1
    1. Advertising

  2. Anthony

    Roedy Green Guest

    On Sun, 6 Jun 2004 05:36:49 +1000, "Anthony"
    <> wrote or quoted :

    >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.

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jun 5, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony Cheng
    Replies:
    1
    Views:
    8,171
    Juan T. Llibre
    Feb 24, 2006
  2. Techsatish
    Replies:
    0
    Views:
    449
    Techsatish
    Aug 25, 2006
  3. Replies:
    1
    Views:
    636
    Jules
    Aug 18, 2005
  4. Jess
    Replies:
    4
    Views:
    424
  5. news.aon.at
    Replies:
    11
    Views:
    625
    Ian Collins
    Jan 29, 2011
Loading...

Share This Page