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

Veröffentlicht am: 14 April 2022
auf dem Kanal: 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.


Auf dieser Seite können Sie das Online-Video Requesting repainting || repaint() method || Java Applets || Java Tutorial for beginners mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Join To Learn 14 April 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 4,238 Mal angesehen und es wurde von 67 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!