Re: Smooth running applet

Discussion in 'Java' started by Roedy Green, Jul 2, 2003.

  1. Roedy Green

    Roedy Green Guest

    On 2 Jul 2003 01:49:11 -0700, (dr) wrote or quoted :

    >I) The animation is not synchronized with the monitor refresh rate.
    >
    >II) The animation works fine on my machine, but might not do so on
    >your machine.


    Make sure you have Swing's setDoubleBuffered( true ).

    If you want it really fast, you will need VolateImages. See
    http://mindprod.com/image.html. I'm a contract programmer and I could
    create you code to do that.

    There you buffer, but your buffer is inside the regen memory of the
    video card already in video card native format. When it is ready you
    blast it onscreen using the 128-bit blt/blt hardware. This is all
    done in pure java with the new VolatileImage class.

    Your problem may come from starting a new frame before the last one is
    finished. Monitor than with the boolean drawImage emits on each pass
    of your paintComponent method. You can use a wait/notify to ensure
    you finish one frame before you start another.

    also setOpaque(true) will suppress background repaint flicker.

    Read my essay on Image. My own code runs way more smoothly without
    artifacts now I understand how it all works under the hood.


    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
    Roedy Green, Jul 2, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Young

    Urgent.... Smooth Refresh

    Bryan Young, Jan 25, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    852
    Jeff @ Dart
    Jan 25, 2005
  2. Tim Tyler

    Re: Smooth running applet

    Tim Tyler, Jul 2, 2003, in forum: Java
    Replies:
    0
    Views:
    861
    Tim Tyler
    Jul 2, 2003
  3. Karl von Laudermann

    Re: Smooth running applet

    Karl von Laudermann, Jul 2, 2003, in forum: Java
    Replies:
    3
    Views:
    1,516
    Tim Tyler
    Jul 4, 2003
  4. Steve Horsley

    Swing missing smooth fonts in Linux

    Steve Horsley, Feb 6, 2004, in forum: Java
    Replies:
    0
    Views:
    1,156
    Steve Horsley
    Feb 6, 2004
  5. Guest
    Replies:
    2
    Views:
    557
    Walter Wang [MSFT]
    Jul 17, 2006
Loading...

Share This Page