src/main/java/org/jwellman/swing/jtable/BetterJTable.java
private JTableHeader createTableHeader() {
        return new JTableHeader(getColumnModel()) {
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                // if this JTableHEader is parented in a JViewport, then paint the
                // table header background to the right of the last column if
                // neccessary.
                JViewport viewport = (JViewport) table.getParent();
                if (viewport != null && table.getWidth() < viewport.getWidth()) {
                    int x = table.getWidth();
                    int width = viewport.getWidth() - table.getWidth();
                    paintHeader(g, getTable(), x, width);
                }
            }
        };
    }
/**
     * Creates a JTableHeader that paints the table header background to the right
     * of the right-most column if neccesasry.
     */
Creates a JTableHeader that paints the table header background to the right
of the right-most column if neccesasry.
Creates a JTableHeader that paints the table header background to the right of the right - most column if neccesasry .
private JTableHeader createTableHeader() {
        return new JTableHeader(getColumnModel()) {
            @Override
            protected void paintComponent(Graphics g) {
                super.paintComponent(g);
                JViewport viewport = (JViewport) table.getParent();
                if (viewport != null && table.getWidth() < viewport.getWidth()) {
                    int x = table.getWidth();
                    int width = viewport.getWidth() - table.getWidth();
                    paintHeader(g, getTable(), x, width);
                }
            }
        };
    }
private JTableHeader createTableHeader ( ) { return new JTableHeader ( getColumnModel ( ) ) { @ Override protected void paintComponent ( Graphics g ) { super . paintComponent ( g ) ; JViewport viewport = ( JViewport ) table . getParent ( ) ; if ( viewport != null && table . getWidth ( ) < viewport . getWidth ( ) ) { int x = table . getWidth ( ) ; int width = viewport . getWidth ( ) - table . getWidth ( ) ; paintHeader ( g , getTable ( ) , x , width ) ; } } } ; }
Creates a JTableHeader that paints the table header background to the right
 of the right-most column if neccesasry.
Creates a JTableHeader that paints the table header background to the right of the right - most column if neccesasry .
// if this JTableHEader is parented in a JViewport, then paint the
 // table header background to the right of the last column if
 // neccessary.
