Hi all,
I'm working on an educational applet for a child with special needs.
He's got a bit of a trick to make my life more difficult... To interact
with the applet he needs to click on buttons, which is fine most of the
time (he comes from a Mac environment, so I accept mouse clicks from the
right or left button when he's working on the PC). But every once in a
while, he'll press and hold the right mouse button, move onto a JButton,
then left-click, which my applet doesn't seem to like (it doesn't
register that the mouse has been clicked).
My *GUESS* of what the problem is is that the mouse event begins when he
is off the JButton, so its not registered with the JButton's mouse
listener (although the Panel it begins on isn't a mouse listener).
When he moves onto the JButton and clicks the new "Mouse Presed" event
isn't passed to the JButton's listener. This doesn't make complete sense
as the JButton DOES detect when the cursor moves on or off the JButton (so
its still registering *some* new mouse events).
The only way I currently see around this is to make the Panel the button
was added to a mouse listener, then pass clicks to the appropriate buttons
depending on the cursor's location. Does anyone have any ideas for a
cleaner way to fix this? The user is non-verbal, so telling him not to do
this isn't an option.
My apologies for the lengthy explaination. I've searched for this, but
couldn't find anyone experiencing something similar. If you have any
suggestions for search terms that I might have missed (my apologies in
advance), I'd love to hear them.
Thanks,
John