This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JTable question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable question" Watch "JTable question" New topic
Author

JTable question

Frank Hale
Ranch Hand

Joined: Mar 25, 2000
Posts: 230
How can I prevent the table columns from being dragged?
Frank
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
hi Frank,
u can do this by using the setReorderingAllowed(false) method of JTableHeader class.
for example

JTable myTable = new JTable(mymodel,myheaders);
JTableHeader head =myTable.getTableHeader();
//// this function will solve your problem
head.setReorderingAllowed(false);
regards
deekasha
Frank Hale
Ranch Hand

Joined: Mar 25, 2000
Posts: 230
Thanks for the code!
Frank
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTable question