detect mouse release on drag n drop (mouse outside table component)

I have a JTable implementing DragSourceListener, DropTargetListener and MouseListener.

im draging and dropping within the same table.

How do i detect mouse release when the mouse is outside the jtable as i have to remove some custom painting on 2 cells.

It seems DragSourceListener takes over mouse events from MouseListener when in drag mode.

[368 byte] By [gaffer_uka] at [2007-10-2 6:16:47]
# 1
I am not a genius about drag and drop, however couldn't you do a muse listent on the form, ie the part where there is no jTable and then according to if there is a drop there see what to do.
sim085a at 2007-7-16 13:18:33 > top of Java-index,Desktop,Core GUI APIs...
# 2

The jtable is the only component in a JDialog 150 x 150 in size, so its easy for a user to start dragging then go outside the dialog and release mouse button. This wouldn't be a problem but i have to remove some graphics painted on 2 of the cells, one cell which is painted with a green border which is start drag and the other is a green line representing the end location for the start drag cell to fit in between. Like Photoshops GUI layer order dialog.

gaffer_uka at 2007-7-16 13:18:33 > top of Java-index,Desktop,Core GUI APIs...
# 3
adding a mouse listener to the dialog as well makes sense. thanks.
gaffer_uka at 2007-7-16 13:18:33 > top of Java-index,Desktop,Core GUI APIs...
# 4
Adding a mouse listener to the dialog does not receive mouse events but my scrollPane does but drag and drop takes over entire events from the whole dialog so i cant check for mouse released.
gaffer_uka at 2007-7-16 13:18:33 > top of Java-index,Desktop,Core GUI APIs...
# 5
this problem is a workaround i think as i cant get the problem from this thread to work: http://forum.java.sun.com/thread.jspa?threadID=686536&tstart=0
gaffer_uka at 2007-7-16 13:18:33 > top of Java-index,Desktop,Core GUI APIs...
# 6
Anyone got any ideas? could i extend DragSourceListener and detect mouse events?how could i achieve this? anyone got an example?
gaffer_uka at 2007-7-16 13:18:34 > top of Java-index,Desktop,Core GUI APIs...
# 7
doesn't the drag source stuff provide a method that tells you when the drag has ended, either successfully dropping the item or cancelling it?
bsampieria at 2007-7-16 13:18:34 > top of Java-index,Desktop,Core GUI APIs...
# 8

> doesn't the drag source stuff provide a method that

> tells you when the drag has ended, either

> successfully dropping the item or cancelling it?

Yes but only components that implement DropTargetListener.

This problem is only a problem because there should be a solution to this problem of mine at this thread: http://forum.java.sun.com/thread.jspa?threadID=686536. But since i can't make it work i had to try it this way which is render my graphics on my table cell label in my TableCellRenderer but should be within DropTargetDragEvent.

gaffer_uka at 2007-7-16 13:18:34 > top of Java-index,Desktop,Core GUI APIs...