What is update method and when it is called?

Answer Posted / mayank

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

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the states associated in the thread? : Java thread

852


What is the meaning of flag day?

778


What is classpath?

786


Can we create a constructor in abstract class?

796


What is difference between wait and notify in java?

834


What is the use of private static?

812


What happens if we override private method?

781


Write a java program to generate fibonacci series ?

844


What do you understand by copy constructor in java?

751


what type of questions asked for barclays technologies pune please send urgent

5466


What is the Difference between Final Class && Abstract Class?

879


What are the procedures?

852


Is simpledateformat safe to use in the multithreaded program?

788


How to sort array of 0 and 1 in java?

762


Is null a string?

794