从另一个paintComponent方法调用paintComponent方法

时间:2015-06-23 15:08:17

标签: java swing jcomponent

调用下面的painComponent方法是正确的:

public class CustomComponent{
   private AnotherCustomComponent anotherComponent;
   @override
   protected void paintComponent(Graphics arg0) {
        super.paintComponent(arg0);
        anotherComponent.paintComponent(arg0);
        arg0.fillRect(100, 100, 50, 150);
   }
}

0 个答案:

没有答案