Reputation: 189686
I want to implement DropTargetListener with a JTable as a target. This is roughly what I would like to do:
@Override public void dragOver(DropTargetDragEvent event) {
MyItem item = getMyItemFromTransferable();
int nrows = item.getTableRowsRequiredForDrop();
// now highlight rows in the table under the drop cursor.
}
How can I figure out which row in the JTable is the row under the cursor where the DropTargetDragEvent is?
Upvotes: 1
Views: 565
Reputation: 191945
I believe it would be:
int row = myTable.rowAtPoint(event.getLocation());
Upvotes: 2