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
Solved

refreshing a canvas in an applet.

Posted on 2002-06-19
2
412 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
eclipse shortcuts 9 62
MySqlDump not dumping triggers 1 43
Convert from a json string array to a Java object 3 51
Selenium docs api java index 3 48
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

840 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