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.
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.
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.
> 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.