Hi Wim,

    A) Swing is huge and takes OO to an extreme, complete with lack of
object reuse.  Java 2D has not really been optimized at this point.

    B) Larger images are naturally slower.  When dragging larger
images, in any graphics environment, one needs to start thinking of
animation techniques, like tracking smaller 'dirty' areas.

    Having said that, when one sees flashing, as was occurring in your
program, one should think of double buffering.  And that was the
problem.  Swing components default to double buffering and I rewrote
your code to take advantage of it  (see attached. )  If you used regular
or lightwight AWT code, you would need to implement double
buffering yourself.  Hope this gives you some ideas for your needs.


                                    Joe Sam Shirah
                                    Autumn Software


-----Original Message-----
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, June 02, 1999 10:55 AM
Subject: [java2d] Dragging transparent images


>I am working on an application where we need to drag transparent images
over
>a JPanel. Using jdk1.2.2 Early Access I cannot get the desired performance
>out of my program. Can anyone have a look at the attached code, I can only
>hope I am doing something wrong and there is a better and faster way of
>doing all this.
>
>Thanks,
>
>Wim
>

ImageDragger.java

Reply via email to