This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JTable question