Ok,
there are plenty of discussion on drag and drop on the news net, but
not many that give an example of how to implement re-ordering of JTable
rows using drag & drop. Could someone point me to a quick overview of
the moving parts that must be taken into account when trying to
implement drag and drop (i.e. what sort of listeners do i need to
implement and where do i need to do this?)
Also, i am suing JDK 1.5. are there any new features/functions added
that make the implementation of drag and drop simpler perhaps?
thanks much
farseer - 28 Jun 2005 20:03 GMT
i guess this is alot more difficult than i thought. Maybe we can start
with just the "dragging".
I can get simple dragging to occur by
-calling JTable.setDragEnabled(true),
-creating a TransferHandler and assigning it to JTable
(JTable.setTransferHandler)
With that, i can click on a row, then click it again and while holding
the left mouse down, drag it. What i see is a "folder" icon being
dragged. BUT, what i want to see is the ENTIRE row being picked up and
dragged. How would i go about doing this?
Do i have to now get into implementing DragGestureListener,
DragSourceListener and DropTargetListener, or can i still do it using
just the TransferHandler?
If I need to implement these "Drag" Interfaces, what methods do i need
to be concerned with if i want show a different icon when dragging (
how would implement so that when a user drags, the entire row is
dragged (visibly, you see the entire row picked up and dragged)).