File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Performance issue while painting on a Graphics2D Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Performance issue while painting on a Graphics2D" Watch "Performance issue while painting on a Graphics2D" New topic

Performance issue while painting on a Graphics2D

Steffen Reinhard

Joined: Jun 13, 2005
Posts: 19
Hi all!

I wrote an Applet for demonstration purposes which includes 64 vectors moving away from a common starting point and rebounding from the surrounding walls, thus gradually filling the applet window and masking part of the underlying signal. The animation works all right but tends to get boringlymind-bogglingly slow after a couple of seconds, as the underlying thread has to draw 64 GeneralPaths consisting of virtually thousands of Line2D objects with every rendering of the BufferedImage.

Is there a way to bypass the cleaning of the bufferedImage so I would only have to render and draw the current line segment?

For the actual code see below:

To view the Applet itself see Hallradius-Demo

I'll be glad to receive any suggestion to improve the shameful performance of my Applet ...

Thanks in advance!

Cheers -

jQuery in Action, 2nd edition
subject: Performance issue while painting on a Graphics2D
Similar Threads
Problem when repainting rectangles
JPanel repainting weirdly
Mouse listener question
Drawing text inside a Graphics2D shape