This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Short answer: yes, your approach is totally wrong. Don't use getGraphics() -- instead, implement a method such that a Graphics is just handed to you at exactly the right time. If you're using a java.awt.Panel, then override paint(). If you're using a javax.swing.JPanel, then override paintComponent().
I'm going to move this to the Swing/AWT forum for followup; I'll see you over there. If you don't understand what I mean about overriding, just say so and I'll larn ya.