• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Repainting of applets

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic