初始化的时候Applet会被调用在内存中,只要不去手工中断或关闭浏览器,这个Applet会一直持续在内存中,哪怕你到别的页面转了一圈。简单的说,init()方法类似main(),是启动的applet的开始。总不能说因为main()方法的事情都可以由别的方法完成就不去用main()?

解决方案 »

  1.   

    An applet's life cycle is controlled by the browser. The four functions 
    1. init()
    2. start()
    3. stop()
    4. destroy()
    are called by the browser at various times.init() is, in some sense, like a constructor, and is called when the applet is first loaded. start() is called when the browser starts the applet's execution when the page is first loaded or revisited.stop() is called when the browser stops the execution of the applet. For example, when the user leaves the page or closes the browser.destory() is, in some sense, like a destrutor and called when the applet is unloaded.
      

  2.   

    其实不用init()很多东西也可以初始化的啊!!!
    init()初始化一次