setOpaque & parent

Is this the normal behavior and I just miss something why it’s important to happen this way?

1, I set a child component to opaque and continuously repaint it.
2, The parent component’s paint method also continuously get called (although with clipBounds to the opaque child)
3, the grandParent’s paint() won’t be called (and that’s good).

That’s quite strange as I would think the parent component’s paint() shouldn’t be called, especially not with the clipBounds of it’s child component that is opaque (why would a parent paint behind the opaque child?). Also there can be a lot of calculations in the parent component’s paint method that shouldn’t happen even if the clip region won’t paint it.

have you called setPaintingIsUnclipped (true) on your child component?

Thanks for the idea, I understand how that would make it a needed repaint, but no I didn’t.

I don’t :slight_smile: the link above was a bug report.
But yes, your issue is different then.

1 Like