glogin
asked on
JTable column problem
My program use JTable to show information in form of table.
Is it possible to disable column swapping feature such that user can only resize the column size, but he/she cannot swapping the columns (eg. swapping column one to column four by drag-and-drop). How to achieve it ?
Thanks.........
Is it possible to disable column swapping feature such that user can only resize the column size, but he/she cannot swapping the columns (eg. swapping column one to column four by drag-and-drop). How to achieve it ?
Thanks.........
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
JTableHeader.setReordering Allowed(bo olean reorderingAllowed)
Sets whether the user can drag column headers to reorder columns.
Sets whether the user can drag column headers to reorder columns.
table.getTableHeader().set
For restricting column resizing use
table.getTableHeader().set
For individual column resizing use
table.getColumnModel().get
NOTE:This does not work (due to a feature) prior to the Java 2 Platform, Standard Editiion, version 1.3 (Kestrel).