File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes JTable 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" Watch "JTable" New topic
Author

JTable

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
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


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Barry Andrews
Ranch Hand

Joined: Sep 05, 2000
Posts: 523

See if this will work

setColumnSelectionAllowed(false) on the TableColumnModel
Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi Barry:
it didn't work, however I found this on google and it works.

dataTable.getTableHeader().setReorderingAllowed(false)

thank for your reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable