Requesting repainting || repaint() method || Java Applets || Java Tutorial for beginners

Published: 14 April 2022
on channel: Join To Learn
4,238
67

Requesting Repainting

• An applet writes to its window only when its update() or paint( ) method is called by the AWT.
• Whenever your applet needs to update the information displayed in its window, it simply calls repaint( ).
• The repaint( ) method is defined by the AWT. It causes the AWT run-time system to execute a call to your applet’s update( ) method, which, in its default implementation, calls paint( ).

• Four forms of repaint()

void repaint( )
void repaint(int left, int top, int width, int height)
void repaint(long maxDelay)
void repaint(long maxDelay, int x, int y, int width, int height)


• The first version causes the entire window to be repainted.
• The second version specifies a region that will be repainted. Here, the coordinates of the upper-left corner of the region are specified by left and top, and the width and height of the region are passed in width and height.
• In 3rd and 4th forms, maxDelay specifies the maximum number of milliseconds that can elapse before update( ) is called.


On this page of the site you can watch the video online Requesting repainting || repaint() method || Java Applets || Java Tutorial for beginners with a duration of hours minute second in good quality, which was uploaded by the user Join To Learn 14 April 2022, share the link with friends and acquaintances, this video has already been watched 4,238 times on youtube and it was liked by 67 viewers. Enjoy your viewing!