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
What is memory leak and how does java handle it?
Where is stringbuffer stored?
What is set string?
How would you convert bytes to string?
What happens if we override only equals?
What is meant by vector class, dictionary class, hash table class, and property class?
How many times finalize method will be invoked? Who invokes finalize() method in java?
Why is String immutable?
What is a static method in java?
What is static import?
When do we use hashset over treeset?
What do you mean by checked exceptions?
What mechanism does java use for memory management?
What is outofmemoryerror in java?
How do you make an arraylist empty in java?