Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / June 2004

Tip: Looking for answers? Try searching our database.

MouseInputListeners and drag'n'drop

Thread view: 
Ian McCall - 15 Jun 2004 18:26 GMT
Hi.

I have a component, a Jwhich implements DragGestureRecognizer and has a
number of MousInputListeners added to it. As soon as those listeners are
added, it loses the ability to recognize a drag gesture (ie.
dragGestureRecognized never gets called). This can be traced exactly to when
the listener, a MouseInputAdapter with only a mousePressed method defined,
is added. If you don't add that listener, drag and drop are recognised.

Any ideas why this should be? Surely adding a MouseInputListener shouldn't
affect the base ability to recognise drag and drop?

Cheers,
Ian
ak - 15 Jun 2004 19:04 GMT
> I have a component, a Jwhich implements DragGestureRecognizer and has a
> number of MousInputListeners added to it. As soon as those listeners are
[quoted text clipped - 5 lines]
> Any ideas why this should be? Surely adding a MouseInputListener shouldn't
> affect the base ability to recognise drag and drop?

probably you call in your MouseInputListener#mouseXxxxx(MouseEvent e)
e.consume();

Signature

http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader

Ian McCall - 15 Jun 2004 19:21 GMT
> probably you call in your MouseInputListener#mouseXxxxx(MouseEvent e)
> e.consume();

No - I looked for that. No consume() call in there at all. The
mousePressed() passes control to an outer classes's handlePress method,
which copies a few values from the event (component, isControDown,
isShiftDown) then creates a Runnable invoked using
SwingUtilities.invokeLater. No consume().

Cheers,
Ian
ak - 15 Jun 2004 19:33 GMT
please post short self contained compilable example.

Signature

http://uio.dev.java.net Unified I/O for Java
http://reader.imagero.com Java image reader



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.