AWT: Why not call update() directly?

M

Marc Twain

I know there must be a good reason, but why not call update() directly
since repaint() only schedules a call to it later on?

TIA,

AJ.
 
R

Roedy Green

I know there must be a good reason, but why not call update() directly
since repaint() only schedules a call to it later on?

Because with repaint, procrastination means you often can avoid the
work, since several repaints can be collapsed into one.

Repaint has a clip region, so it only paints what really needs it.

You have to co-ordinate your painting with the repaints generated by
the user dragging and clicking. Hence the queue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top