• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi:
By default user can move columns in differnt column position in JTable. How can I stop this behaivior? I don't want the user to be able to change the columns position in the table.
thanks
 
Barry Andrews
Ranch Hand
Posts: 528
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See if this will work

setColumnSelectionAllowed(false) on the TableColumnModel
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Barry:
it didn't work, however I found this on google and it works.

dataTable.getTableHeader().setReorderingAllowed(false)

thank for your reply
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic