aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTable Column View 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 "JTable Column View Order" Watch "JTable Column View Order" New topic
Author

JTable Column View Order

Balachandran Paranjothimani
Ranch Hand

Joined: Jun 18, 2005
Posts: 43
I have a JTable that gets the number and sequence of columns from options menu. The user can select which fields must be displayed in the table as well as its order.

I have extended the AbstractTableModel class to implement the getValue, setValue and other methods.

In order to hide the columns that the user has not selected in the options I am using table.getColumnModel().removeColumn(table.getColumn(columnName)); This just hides the column from the view but it is still in the model.

The problem is how to rearrage the view order of the columns during runtime? The user can change the order anytime and the display must reflect those changes. Any ideas on how I can do this? TIA.


Moderator : <a href="http://groups.yahoo.com/group/OOAD_UML/" target="_blank" rel="nofollow">http://groups.yahoo.com/group/OOAD_UML/</a><br />Home : <a href="http://www.zepho.com" target="_blank" rel="nofollow">http://www.zepho.com</a>
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
 
wood burning stoves
 
subject: JTable Column View Order