This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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: 42968
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)?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic