sample of java applet life cycle