How to reorder JTable



Is there any code examples on the web about how to reorder the
rows in a JTable (using a generic javax.swing.table.TableModel) by drag
and drop ?

I have found these two exampes:
http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/
http://forum.java.sun.com/thread.jspa?threadID=497065&messageID=2431829
but both of these are downcasting to a
javax.swing.table.DefaultTableModel
and I would like to see an implementation that works for any
TableModel.

Since I do not need features that enables dragging and dropping between
different GUI components, but just want to be able to move rows within
the same table, I am wondering if it still really is necessary to use
the packages java.awt.datatransfer and java.awt.dnd, or if it then can
be done in a less complicated way ?
(and if it can be easier, then a link to some nice source code would be
great, please)

/ Tom

.



Relevant Pages

  • Re: Ordering tracks in Nero?
    ... But I don't like the song order that the producer chose for the CD, so in the copies, I'd like to reorder them. ... source disc. ... What you want to do is make a fresh CD (master) using the ... appropriate drive and drag the tracks to the left pane. ...
    (comp.publish.cdrom.software)
  • Re: Visio-Insert Page dialog should allow you to place in order
    ... Lori Pearce ... At least it lists all the pages and allows you to reorder. ... > easier then drag drop, slide, drag drop, slide... ...
    (microsoft.public.visio.general)
  • Re: DLA??? What is it..
    ... >It has DLA Help ... DLA is one of the packages that allows you to do true 'Drag and Drop' ... burning of CDs, using 'packet writing'. ...
    (microsoft.public.windowsxp.general)
  • RE: Visio-Insert Page dialog should allow you to place in order
    ... At least it lists all the pages and allows you to reorder. ... easier then drag drop, slide, drag drop, slide... ...
    (microsoft.public.visio.general)
  • Re: GPO and Software Installation
    ... The packages already exsist. ... Is there a way to reorder them without deleting and then re adding them? ... In other words can you "drag and drop" the exsisting packages? ...
    (microsoft.public.windows.server.active_directory)