You should be able to cast the DropLocation object to javax.swing.JTable.DropLocation which has methods to return which column, row etc the user is trying to drop the data into.
Thanks.
I did some analysis of my old method and the 'JTable.DropLocation' implementation
and it looked like either way the correct drop point is there once the mouse button
is released. However, the 'JTable.DropLocation' method seemed to better track the
mouse drag movement.
Below is the revised 'canImport' method with my original method commented out…
I have an additional question if I may.
In my 'getSourceActions' override method I return a "TransferHandler.MOVE" int
iff the Table Model column is > 0 [i.e. == 1 of 2]…
Also my JTable [emissariesTable] setting are as follows:
emissariesTable.setDragEnabled(true);
emissariesTable.setDropMode(DropMode.USE_SELECTION);
emissariesTable.setTransferHandler(new JEmissaryReportTransferHandler());
What i need to accomplish is to have the drag
String set to a Null String after the drag String is dropped in the destination column cell…
That is what I thought the DnD MOVE process would do.
To satisfy my requirement, I went and added some code to my TransferHandler.
My JTable is dynamic in that rows are added and removed during run time by my code.
Therefore, the added code was somewhat difficult [for me anyway] and still has a bug to be fixed.
My question is as follows:
Have I overlooked something in my basic DnD JTable settings so that
the MOVE will work as I expected without my "kluge" code?
Here is the JEmissaryReportTransferHandler with the added code to perform the MOVE:
Regards,
Jim...