• Post Reply Bookmark Topic Watch Topic
  • New Topic

Wierd JTable Behavior

 
Sam Zheng
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that the default JTable allows user to drag the column and change the sequence of the column on the table. For example, if I have a JTable with column in the following sequence
A B C D
Once I create such a table, I will be able to drag the column and re-shuffle its sequence on the fly, such as
B D C A
How can I turn off this feature so that the table column sequence will be fixed, cannot be changed by users?
Thanks!
Sam
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Call theTable.getTableHeader().setReorderingAllowed(false).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!