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.
though you haven't given the code for the class which extended JPanel, i am pretty sure you haven't called
super.paintComponent(); in the paintComponent() method of the extending class.
you see in swing you dont override the paint() method, but the paintComponent(),paintBorder() and
Check it out as i was facing the same problem.