This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Are there any 3rd party components out there that let you issue Graphics2D drawing commands outside of the paint() method? Or are we always stuck with overriding this method and issuing all commands there?
All you have to do is cast getGraphics() to Graphics2D and use it normally. However, it's always better to do this in the paint method because that's what gets called in the redraw loop built in to Swing.
I guess you could create a BuffedImage to draw to and have the component reference the same BufferedImage in it's paint() method. You'd still have to remember to call repaint() every time you made changes, though...
If you explain what exactly are you trying to do I might be able to offer more direction.
Write once, run anywhere, because there's nowhere to hide! - /. A.C.