This week's giveaway is in the Spring forum.
We're giving away four copies of Learn Spring Security (video course) and have Eugen Paraschiv on-line!
See this thread for details.
Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Graphics2D issues

Oscar Bartman
Posts: 10
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic