Calling paintComponent method from another paintComponent method

42 views Asked by At

is it right to call painComponent method like below:

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

There are 0 answers