File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Graphics2D issues

Oscar Bartman
Posts: 10
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I made my extension of JPanel and am trying to use an instance of Graphics2D in order to draw it up. It's supposed to look like a clock eventually but never mind that now. The problem is that when I implement the paintComponent(Graphics g) method I lose the background that was implemented in the initialize method. I tried moving the contents of initialize to the constructor but that doesn't help the problem. All I see is what I draw up in the paintComponent method, and the background disappears. Does paintComponent override initialize, somehow?

Here's my JPanel extension:

Some of it is in Dutch (again). AFMETING means size, STRAAL is the radius of the circle.

If anyone could give me a hand with this would be awesome. I was here before with a problem and was very impressed with the helpful people on this forum.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic