jtable drag and drop a row

T

tiewknvc9

Hi thanks for reading.

Im trying to write some code that will allow me to click on a jtable's
row, and drag it to another location on that same jtable, and drop it
into place.

I extended the jtable class and tried this in it's new constructor:

//drag and drop
this.setDragEnabled(true);
this.setTransferHandler(new TransferHandler("RowMe"));

this doesn't seem to do anything... any ideas?
 
M

mrandywarner

You need a class that implements the Transferrable interface and a
TransferHandler that knows how to make a Transferrable out of the
objects in your table. It will also control how the transferrable
objects are taken and used to construct an object to insert in your
table again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top