refreshing a canvas in an applet.

 I am working on a project which opens a Frame from within an applet.WHenever I draw an image  and another  window covers the image in the canvas, the image disappears and I have to click drawPlat(bal/unbal) again to get it back. I am trying very hard but could not find a Solution. I will really appreciate any helps.

The URL is:

The java file is:

Please help me and I will greatlt appreciate .

Note: I am supposed to use just basic Java.

Who is Participating?
objectsConnect With a Mentor Commented:
Painting of your FCanvas object is done from a seperate component. You should instead be handing the painting inside the FCanvas class:

class FCanvas extends Canvas{
     public void paint(Graphics g){
         // paint calls should in here
Sounds like your not painting the image in the components paint() method. The paint() method is called whenever part of a component is required to be redrawn so all painting should be performed in the is method.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.