p*******y 发帖数: 133 | 1 I am confused what is the relationship between these three.
it seems most of the time, repaint() calls update(), and update()
calls paint().
but sometime we override update() and put all the code for
painting there, without overriding paint(), the graphics just
wouldn't be painted.
I checked the java API for the repaint() description. it seems
sometimes it calls paint() directly, but only when the component
is lightweighted. In all my GUI, i just used AWT, would that
be a problem, i mean maybe t | KG 发帖数: 515 | 2 You can read this article to get a better picture of the differences.
http://java.sun.com/products/jfc/tsc/articles/painting/index.html
【在 p*******y 的大作中提到】 : I am confused what is the relationship between these three. : it seems most of the time, repaint() calls update(), and update() : calls paint(). : but sometime we override update() and put all the code for : painting there, without overriding paint(), the graphics just : wouldn't be painted. : I checked the java API for the repaint() description. it seems : sometimes it calls paint() directly, but only when the component : is lightweighted. In all my GUI, i just used AWT, would that : be a problem, i mean maybe t
|
|