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);
}
}