To get liquid animation (if that's what you want to get), you need to use double buffering. To do this, you will need to create a new java.awt.Image (or a subclass like BufferedImage, or if you want OpenGL accelerated processing, VolatileImage) for each frame that you want to display. If you have not already done so, call Image.getGraphics () to get the java.awt.Graphics object (it may also be useful to add your content to the image). In the end, when you finish the hidden image, call Graphics.draw () to replace the current display smoothly.
VolatileImage is OpenGL faster and much faster. When VolatileImage.getGraphics () is called, it actually returns Graphics2D, which is also part of the accelerated graphics pipeline.
It runs on Windows, Linux, and Solaris, but you need to install OpenGL drivers for your graphics card.
Some sitelinks include:
Accelerated Graphics Pipeline:
http://download.oracle.com/javase/1.5.0/docs/guide/2d/new_features.html
http://www.javalobby.org/forums/thread.jspa?threadID=16840&tstart=0
Double buffering:
http://www.java2s.com/Code/Java/2D-Graphics-GUI/Smoothmoveusingdoublebuffer.htm
http://www.heatonresearch.com/articles/23/page2.html
http://www.javacooperation.gmxhome.de/BildschirmflackernEng.html
source share