How to reorder JTable
- From: tomjbr.16324861@xxxxxxxxxxxxx
- Date: 30 Sep 2005 03:25:40 -0700
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
.
- Follow-Ups:
- Re: How to reorder JTable
- From: tomjbr . 16324861
- Re: How to reorder JTable
- Prev by Date: Coding Challenge
- Next by Date: Re: custom Swing component
- Previous by thread: Coding Challenge
- Next by thread: Re: How to reorder JTable
- Index(es):
Relevant Pages
|
|