Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Painting from an applet

 
Christopher Young
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's a good way to go about doing this?

I have to make an applet for school, it's a team project (But frankly we haven't been working much as a team) and the only way we know how to (or can think of) is to call repaint() from the paint method.

Is there a better way? Because that seems to use up memory if there's a lot of stuff.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Painting in an applet is the same painting in an application; you'd use the paint method (if you're using AWT) or paintComponent (if you're using Swing).

Could it be that there's a memory leak somewhere, or that you're performing something particularly memory-intensive (e.g. image operations)?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic