Trouble with paintComponent()
I have two subclassed components, a JPanel and a JButton. I've overwritten their paintComponent() methods to handle their display. Problem is, I've put the new JButtons in the new JPanel, and the graphics arent displaying properly. I've done a little testing and found that whenever the JButtons are being repainted, they are calling the JPanels paint methods as well, but the JPanel's paintComponent method is only being given the graphics context for the small region that needs to be updated.
The way my graphics are displayed, this won't work. I have to repaint the entire JPanel every time. Does anyone know how to do this?
And before the question comes up, yes I realize repainting the whole thing doesn't seem like the most efficient approach, but I have yet to put together a suitable workaround and would prefer this method anyway.