Campbell Ritchie wrote:Of course you can do that. There are many ways to do that. One way is to use a javax.swing.Timer to update the image.
Don’t update the image more than 50 times a second; you can’t see 50 changes a second, and you need at least 10ms for the repainting.
Don’t update the image less than 25 times a second, or it will appear jerky.
Make sure to use the super. call as the first line in the paintComponent method.
thanks i have implemented the solutions also but , now the problem is CPU consumption which is 100% for 22.22 fps and 98-96% for 10 fps ....my pc is single core 2.8 GHZ with 2GB of Ram
and my solution or software is for non tech people whose configuration is quite similar to mine..
Note: Currently mine solution is single threaded ...what efforts i can make so that it takes near about 40-50 % of cpu or even less ?