This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wierd JTable Behavior  RSS feed

 
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: 24217
38
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!