List of usage examples for javax.swing.table JTableHeader resizeAndRepaint
public void resizeAndRepaint()
From source file:com.projity.pm.graphic.spreadsheet.SpreadSheet.java
public void resizeAndRepaintHeader() { JTableHeader header = getTableHeader(); SpreadSheetColumnModel tm = ((SpreadSheetColumnModel) getColumnModel()); int colWidth = tm.getColWidth();// tm.getTotalColumnWidth(); //Hack, // colWidth isn't enough why? header.setPreferredSize(new Dimension(colWidth, header.getPreferredSize().height)); header.resizeAndRepaint(); }