|
Apologies - just saw that you're using Ubuntu 8.04 and Sun JDK 6u14. Can you run this on the latest Ubuntu distribution so that we have the same latest versions to compare against? I've ran this demo with Sun JDK - my previous comment was incorrect since there are problems with OpenJDK WebStart for Trident [1]. Thanks This is a sample application that test threading / repainting as done in Trident: package test; import java.awt.Color; import javax.swing.*; public class Tracing extends JFrame { @Override this.add(mainPanel); new Thread() { @Override public static void main(String[] args) { } Can you run this on your machine and attach a few lines of the output? On my Windows box it prints this: Sleeping interval is 40 For every timing pulse, there's a matching repaint. Perhaps on your Ubuntu box there will be many more sleeps than paints? In this case i would guess you'll need to call paintImmediately instead of using SwingRepaintTimeline that just calls repaint(). Thanks Hi Kirill. I've not got the latest Ubuntu installed. I'll be able to update my home pc, but not for a couple of days. However, when I had the problem with the TimingFramework a while ago, it wasn't a hardware problem as I was dual booting. It looked fine on windows, but bad on linux. I've ran the sample program you have supplied and this is the output: Painting interval is 40 I don't think it is trident's fault as I've had this problem before, I was just hoping you could get round the problem somehow. Thanks, Nick. As Windows is my only development environment, and i don't see the jerky animations on my Ubuntu installation, i don't think that i can help much in analyzing this problem. At the present moment this will be left for the interested members of community. Thanks |
|||||||||||||||||||||||||||||||||||||||||
Finally got around to installing the latest Ubuntu and OpenJDK. Running this WebStart link on my machine, i don't see any jerkiness - i'm not moving the mouse or using Toolkit.sync().
Can you provide a little bit more information about your system? OS, OpenJDK version + CPU specifications?
Also, since you've mentioned TimingFramewor has the same problem, perhaps this has nothing to do with Trident. At the very basic level, Trident has a thread that wakes up every 40ms and handles all timelines. Can you create a Trident-less application that has a Thread running in an infinite loop and calling repaint() on some JPanel every 40ms. Then, print tracing statements in the JPanel.paintComponent() to see what are the time intervals between successive invocations of this method - since JComponent.repaint() is effectively an asynchronous call that can coalesce multiple painting events - and this is what might be happening based on your description.
Thanks
Kirill