Solved

refreshing a canvas in an applet.

Posted on 2002-06-19
2
411 Views
Last Modified: 2006-11-17
Hi,
 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:
http://www.cse.sc.edu/~group8/beta6/

The java file is:
http://www.cse.sc.edu/~group8/beta6/SurveyApp.java

Please help me and I will greatlt appreciate .

Note: I am supposed to use just basic Java.

Thanks
0
Comment
Question by:Alfred_here
  • 2
2 Comments
 
LVL 92

Expert Comment

by:objects
ID: 7094350
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.

0
 
LVL 92

Accepted Solution

by:
objects earned 150 total points
ID: 7094359
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{
     FCanvas(){
          super();
     }
     public void paint(Graphics g){
         // paint calls should in here
     }
}
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
netstat -ano | find "8000" and taskkill /f /pid 2984 3 55
Arrays.asList  VS  ArrayList 4 54
javap bin 2 34
Oracle SQL syntax check  without executing 6 50
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now