When is update method called ?

When is update method called ?

The update() method is defined by the AWT and is called when your applet has requested that a portion of its window be redrawn. The problem is that the default version of update() first fills an applet with the default background colour and then calls paint().

 You can override the update() method. The paint() in this case will simply call update(). public void update(Graphic g) { //Redisplay your window here.}public void paint(Graphics g) { update(g); // call to the update()method.}


By:Jalees
Date:2013-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher