This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes fps is slowing down Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "fps is slowing down" Watch "fps is slowing down" New topic

fps is slowing down

Jochem Gruter

Joined: Aug 16, 2011
Posts: 9
My fps is slowing down. I begin at 60 fps and after 5 minutes it is 30 and after 15 minutes it is 5 fps.

My paint is in a jPanel and I've just painted some text and rects.
Darryl Burke

Joined: May 03, 2008
Posts: 5045

Use a Swing Timer, not Thread#sleep(...) for animation. And never never run an infinite loop or sleep on the EDT.


luck, db
There are no new questions, but there may be new answers.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20132

Also, Thread.sleep(17) will sleep 17 milliseconds, not 17 seconds.

How To Ask Questions How To Answer Questions
Stephan van Hulst

Joined: Sep 20, 2010
Posts: 4094

*scratches head*

It's not necessarily on the EDT right? And 17 ms seems like a decent amount to get around 60fps.

Anyway, I don't see why the OP is messing with thread priorities.

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
I agree. Here's the link:
subject: fps is slowing down
It's not a secret anymore!