• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing Panel Repaint Problem  RSS feed

 
Khurram Mahmood
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me in following scenario?
I have an JApplet(name MainApplet) on which I have a JPanel(name DrawingPanel)on which I have another JPanel (named canvas)on which I draw using mouse when this apllet is repainted or DrawingPanel or canvas is repainted the painting is done fine but after the painting id done the canvas becomes blank and whole the drawing becomes wasted.
Thanking You.
Khurram Mahmood.
 
Rehan Malik
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm I remember I had a similar problem to what you are having.
i think my work around was that I had to invalidate the revalidate the panel in order for it to work. either that or i cheated and did something else which I can't remember.
Possible solutions off the top of my head:
1. revalidate panel
2. call super.repaint() in your repaint method.
I'm not saying they're 100% going to work but it's worth a shot.
Originally posted by Khurram Mahmood:
Can anybody help me in following scenario?
I have an JApplet(name MainApplet) on which I have a JPanel(name DrawingPanel)on which I have another JPanel (named canvas)on which I draw using mouse when this apllet is repainted or DrawingPanel or canvas is repainted the painting is done fine but after the painting id done the canvas becomes blank and whole the drawing becomes wasted.
Thanking You.
Khurram Mahmood.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!