Example usage for javax.swing.table JTableHeader resizeAndRepaint

List of usage examples for javax.swing.table JTableHeader resizeAndRepaint

Introduction

In this page you can find the example usage for javax.swing.table JTableHeader resizeAndRepaint.

Prototype

public void resizeAndRepaint() 

Source Link

Document

Sizes the header and marks it as needing display.

Usage

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();

}