Jim
Professional Computer Solutions...
How are you determining which table column you are dropping onto are you using the JTable.DropLocation class?
Jim
Professional Computer Solutions...
You need to limit which columns can be dragged from so I think you need to override getSourceActions() to return the type of transfer action available on the currently selected cell of the JTable. The cells which can't be dragged from return NONE.
For dropping the data you need to use the canImport() method to limit where the data can be dropped. The TransferSupport object passed into the method can be used to get the DropLocation object which can then be used to determine where the user is attempting to drop the dragged data.
BTW I take it you are setting the JTable's drop mode to a suitable value and are enabling dragging on the JTable.
Jim
Professional Computer Solutions...
I played with this but was unable to use it as directed.
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.
Let's go to the waterfront with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|