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

Publié le: 14 avril 2022
sur la chaîne: 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.


Sur cette page du site, vous pouvez voir la vidéo en ligne Requesting repainting || repaint() method || Java Applets || Java Tutorial for beginners durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Join To Learn 14 avril 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 4,238 fois et il a aimé 67 téléspectateurs. Bon visionnage!