考虑下面的Java代码,如果JPanel类中没有paintComponent方法,会发生什么?
..。
import javax.swing.JPanel;
public class ShapesJPanel extends JPanel
{
public void paintComponent( Graphics g )
{
super.paintComponent( g );
//more codes here
}
}发布于 2009-11-10 03:14:53
在超类中总会有一个实现。
JPanel实现了paintComponent()。所以,你不需要担心它。
https://stackoverflow.com/questions/1703103
复制相似问题