Painting full component


I have created a custom component which consists of a container component with a filled rounded rectangle that spans the the full width and height. I have then added two buttons on the container, which are transparent. What I want to happen is that when the mouse is over any one of the two buttons, that that the paint functions of all three are called. 

At the moment if I mouse over any one of the two buttons, the paint function of the parent container is called, but it is clipped to the region of the moused over button, so it doesn't repaint the full rounded rectangle. How do I make it so that mousing over any button causes the paint functions of the other button and the container component to be called.


You could probably add your custom component as a mouse listener to the buttons and call repaint on each component when you receive the appropriate mouseX method call.

Ok, I have it working now, thanks for the tip!

I just thought their might have been a flag somewhere to paint the entire container component instead of just the area of the graphics context of the moused over component.