/* * Indicate whether changes to the model should cause the width to be * dynamically recalculated. */ public void setDynamicAdjustment(boolean isDynamicAdjustment) { // May need to add or remove the TableModelListener when changed if (this.isDynamicAdjustment != isDynamicAdjustment) { if (isDynamicAdjustment) { table.addPropertyChangeListener(this); table.getModel().addTableModelListener(this); } else { table.removePropertyChangeListener(this); table.getModel().removeTableModelListener(this); } } this.isDynamicAdjustment = isDynamicAdjustment; }
public TableController(JTable jTable, Feed feed, Frame frame) { this.jTable = jTable; this.feed = feed; this.frame = frame; tableModel = (DefaultTableModel) jTable.getModel(); }