Two Laptop Bag*
The moose likes Applets and the fly likes Repainting of applets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Repainting of applets" Watch "Repainting of applets" New topic
Author

Repainting of applets

N SRao
Greenhorn

Joined: Nov 13, 2001
Posts: 11
Hi,
I am running the applet which has menubar,toolbar with lot of images and where user can drag and drop the images on the panel provided in the applet itself. My problem is when ever i refresh the screen by clicking the refresh button on the browser the entire applet will be appear distorted with the toolbar, menubar, images and all the other panels in the applet will appear double and none of the events will be fired.
so kindly let me know what will be the solution
thanks
subba
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

Invoking the browser's refresh probably repaints damaged or unprocessed regions of the browser space. Your applet's repaint() method should get called eventually, and the system will then "decide" which areas need repainting.
repaint() in the Applet class calls update(), which blanks the display area and draws a filled rectangle; this is followed by a call to paint() which does the rendering.
It may be the code you are using doesn't have the paint() method implemented with this is mind. Sometimes people will override the update() method to eliminate the screen wash, but forget to clear the screen some other way before redraw. Then you get what looks like a superimposition of two views on one space.
Take a second look at the paint() code with this in mind.
------------------
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Repainting of applets
 
Similar Threads
Menu+Tool
displaying window without toolbar
Screen Resolution
Hide toolbar of EXISTING window
IE 6 hide menubar, toolbar in current window