Overlay vs PaintComponent

Hello All,

I’m working on creating some custom Java2d components for a GLJPanel. I was wondering if it’s more appropriate to override the GLJPanel paintComponent() method or create an Overlay object and use the graphics object from that. Or does it make much of a difference. The paintComponent() seems to be working fine so far.

Thanks!

I typically override paintComponent in the container I’m actually drawing in, and I think it’s the recommended method.

Look at the JGears (not Gears) JOGL example…it shows an example of overriding the paintComponent() and I use it myself.