1

好吧,真正的快速问题。我知道 C# Forms 具有 OnPaint() 方法,该方法在渲染时会不断被调用。我知道 Java 也有类似的,但我不知道如何实现它。任何指针或示例(首选)将不胜感激。非常感谢。

4

2 回答 2

2

如果使用 Swing,请避免在顶级容器中绘画(例如JAppletor JFrame)并使用JComponentor JPanel

对于后两个类中的自定义绘画,请使用paintComponent(Graphics).

于 2011-11-08T07:44:17.117 回答
1

Component#paint()方法。

于 2011-11-08T07:24:10.760 回答