views:

82

answers:

1

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?

+2  A: 

I believe it would be:

int row = myTable.rowAtPoint(event.getLocation());
Michael Myers
thanks!........
Jason S