This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Swing Panel Repaint Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Swing Panel Repaint Problem" Watch "Swing Panel Repaint Problem" New topic
Author

Swing Panel Repaint Problem

Khurram Mahmood
Greenhorn

Joined: Jul 13, 2001
Posts: 8
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

Joined: Jul 09, 2001
Posts: 76
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.


Rehan Malik
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Swing Panel Repaint Problem
 
Similar Threads
Drawing in XORMode or Layers?
Can't draw on JFrame or its ContentPane.
much trouble reading files
inserting canvas in a panel
Artifacts appearing outside of JScrollPane