life cycle of applets example