Overriding update method Assignment Help

Assignment Help: >> Applet Initialization and Termination - Overriding update method

Overriding update():

In some conditions, your applet might required to override another method defined through the AWT , called update(). This method is called whenever your applet has requested in which a portion of its window be redrawn. A default version of update() first fills an applet along with the default background color and then calls paint(). If you fill the background using a various color in paint (), a user will experience a flash of the default background every time update() is called- that is , whenever the window is repainted. One way to prevent this problem is to override the update() method so in which it performs all necessary display activities after that have paint() simply call update(). Therefore, for a few applications, an applet skeleton will override paint () and update (), as displays here.

public void update(Graphics g){

//redisplay your window, here.

}

public void paint(Graphics g){

update(g);

}

For the instance in this book, we will override update() only when required.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd