A parent component and it's child


trying to keep this simple - lol I’m noob to this, but I’ve got this issue with my parent’s :shock: child component being troublesome! It’s misbehaving!
seriously, Ive got a maincomponent window and I’ve given it a child component. When I setvisible(true) my childcomponent, everytime it’s painted, or repaints it paints the parent component (replicates it) in my child component. lol. I know I can just use setOpaque or some bodge-job paint white methods to blot all this out but I don’t like it. How to I tell my parent component to not draw itself in my child component? or more precisely, how do tell my child component to not worry about replicating it’s parent inside it? lol It’s a major error on my part, please help?!


I don’t understand what the problem is?

What you’re describing is how every modern computer UI system works. Stuff gets painted from back to front.

If something’s opaque, then call setOpaque(). If it’s not opaque, then obviously the parents need to draw themselves before it can have a surface to paint over…


I gotcha mate. I think I got the put the parent component and it’s child in the situation where they are both children of an (empty) parent component.