The moose likes Swing / AWT / SWT and the fly likes How to place JTable rows in desired order Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to place JTable rows in desired order" Watch "How to place JTable rows in desired order" New topic
Author

How to place JTable rows in desired order

viswanath kuppam
Greenhorn

Joined: Feb 27, 2004
Posts: 3
I need to implement a feature like, JTable will display list of rows and each row will contain two buttons like uparrow and downarrow. whenever user clicks on uparrow then corresponding row should move one row up. In the same way whenever user clicks on downarrow correspond row should move one row down.
Can you please suggest how to achieve this, It will great if I get piece of code.
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
If you are using a DefaultTableModel, this class has a moveRow(...) method.
Otherwise you will have to provide one yourself.


SCJP2. Please Indent your code using UBB Code
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to place JTable rows in desired order