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

Опубликовано: 14 Апрель 2022
на канале: 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.


На этой странице сайта вы можете посмотреть видео онлайн Requesting repainting || repaint() method || Java Applets || Java Tutorial for beginners длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Join To Learn 14 Апрель 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 4,238 раз и оно понравилось 67 зрителям. Приятного просмотра!