JTable, disable user column dragging
JavaSwingJtableJava Problem Overview
I have declared my JTable
as:
data_table = new JTable(info, header) {
@Override
public boolean isCellEditable(int row, int column) {
return false;
}
};
But I've seen that at runtime it's possible to drag the columns with mouse. How can I disable that?
Java Solutions
Solution 1 - Java
data_table.getTableHeader().setReorderingAllowed(false);
should do the job, unless you mean that the user can resize column headers.