Solved

refreshing a canvas in an applet.

Posted on 2002-06-19
2
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
login form jsp example 2 53
jsp login check 12 53
Website checklist for browser compatibility? 2 38
Java array 21 87
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

726 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