• 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

The way to accumulate drawn objects on the screen is to

 
Ranch Hand
Posts: 216
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
27)

The way to accumulate drawn objects on the screen is to


a) Call accumulate() from within paint()

b) Call update() from within paint()

c) Call update() from within repaint()

d) Call paint() from within update()

e) Call paint() directly

 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The (abbreviated) default update() method CLEARS THE BACKGROUND and then calls
paint():
<PRE>
public void update(Graphics g) {
g.clearRect(0, 0, width, height);
paint(g);
}
</PRE>
So just override update to say:
<PRE>
public void update(Graphics g) {
paint(g);
}
</PRE>
 
reply
    Bookmark Topic Watch Topic
  • New Topic