Mohsan Khan wrote:
>All my drag events print their method name, which they do first of
>all, adfter that some other stuff.
>
>In dragEnter(), the animation thread is created & started if it isn't
>running already.
>But this shouldn't matter because I have a print method at first.
My point was that creating the animation thread may take so much time that
the system is losing the dragExit event. Printing "dragEnter" first does
nothing to alleviate that. You have to consider the entire elapsed time
spent in the handler, because that's what affects the OTHER handler methods
being called.
Your system sounds fast enough that even creating and starting a thread
should be fast, but without knowing what the code in that thread is doing
(e.g. maybe loading an animation), I'm really just guessing.
I suggest stripping down all your DnD handler methods to the bare bones.
No animation, no repaints, no drawing, just a println()**. Then see if
there's a difference in the disappearing events.
If events no longer disappear, then it's a good bet that your code is just
taking too long, so you have to make it work faster to avoid having the
system lose events. If there's no change, though, and it still loses
events, then it's a good bet it's Java's fault, not yours, so then you have
to file a bug-report and invent a work-around.
** Even println() takes time, so you may have to choose something else
that's even faster, and defers the slow stuff (like printing to console)
until periods of less activity.
The purpose of this is simply to discover where the fault most likely lies.
Once you know that with some certainty, you can devise an appropriate
remedy.
You could spend days optimizing the speed of your animation startup, but if
that's not where the fault lies, you're wasting your time. Alternatively,
you could spend days trying to find the bug in Java's events, but if it's
your animation startup, then that's also a waste of time.
The first step to finding a solution is to pick the right problem to solve.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden
This email sent to email@hidden