• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Column View Order

 
Balachandran Paranjothimani
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic