File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 4522

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: 19541

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: 3366
*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.
I agree. Here's the link:
subject: fps is slowing down
Similar Threads
doubt abt priorities in threads.......
are there webapp size restrictions?
setPriority(int i) method of Thread
MouseMotionEvent Performance
Set Thread priorities based on certain conditions