JTable, disable user column drag and drop

I declared my JTable as:

 data_table = new JTable(info, header) { @Override public boolean isCellEditable(int row, int column) { return false; } }; 

But I saw that at runtime you can drag and drop columns with the mouse. How can I disable this?

+49
java swing jtable
Jul 14 '13 at 16:09
source share
1 answer

data_table.getTableHeader().setReorderingAllowed(false); should do the job unless you mean that the user can resize the column headers.

+99
Jul 14 '13 at 16:21
source share



All Articles