repaint()
カスタムで関数を呼び出すと、正しくJPanel
再実行されると理解していpaintComponent(Graphics g)
ますか? それとも全体を再作成しJPanel
ますか?助けてくれてありがとう。
質問する
142 次
1 に答える
4
+1 to trashgod.
The docs for repaint()
state:
Repaints this component.
repaint()
causes AWT to invoke update()
(for heavyweight components which will then invoke paint()
) or paint()
(for lightweight components) on EDT which in-turn invokes paintComponent(...)
.
so no it is not re-created every time repaint()
is called.
Reference:
于 2012-10-20T22:42:42.463 に答える