Reputation: 10068
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?
Upvotes: 77
Views: 57316
Reputation: 21
To anyone having this problem using Netbeans IDE you can disable the user from dragging columns in the JTable by doing the following steps.
Upvotes: -1
Reputation:
data_table.getTableHeader().setReorderingAllowed(false);
should do the job, unless you mean that the user can resize column headers.
Upvotes: 142