How to override update( ) method in Applet in Java?

By using update( ) method, you can have fill a background color for the applet. Then, paint( ) method could be called for further drawing. The only problem is a user will see for a second the default background color, every time update( ) method is called. To avoid this, you can override the update( ) method:

public void update(Graphics g) {

// Codes to redisplay the window


public void paint(Graphics g) {



Leave a Reply