Re: How to reorder JTable



> I have found these two exampes:
> http://java.sun.com/docs/books/tutorial/uiswing/misc/example-1dot4/
>...

By the way, it was the ExtendedDnDDemo example I was refering to at the
above page.


tomjbr.16324...@xxxxxxxxxxxxx wrote:
> 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

.