|
Fixed First Column |
Top Previous Next |
You can make the first column of the table non-reorderable and irremovable by calling AdvancedJTable's method:
public void setFirstColumnFixed(boolean isFirstColumnFixed);
So,
AdvancedJTable table = new AdvancedJTable();
table.setFirstColumnFixed(true);
The first column will now be locked in place.
If you try to drag another column over to the first column, your dragging will be cancelled without moving the first column.
You can also query the state of the first column by calling:
public boolean isFirstColumnFixed();
Note: In order to make the first column non-reorderable and irremovable, AdvancedJTable uses subclasses of DefaultTableColumnModel (AdvancedJTable.InnerTableColumnModel) and JTableHeader (AdvancedJTable.InnerTableHeader) as its table column model and header respectively. Therefore, if you would like to use your own table column model or header, your classes must extend AdvancedJTable's inner classes mentioned above.