code: private static Border createTableHeaderEmptyColumnPainter(final JTable table) {
          return new AbstractBorder() {
              @Override
              public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
                  // if this JTableHeader is parented in a JViewport, then paint
                  // the table header background to the right of the last column
                  // if neccessary.
                  Container viewport = table.getParent();
  
                  if ((viewport instanceof JViewport) && table.getWidth() < viewport.getWidth()) {
                      int startX           = table.getWidth();
                      int emptyColumnWidth = viewport.getWidth() - table.getWidth();
  
                      TableCellRenderer renderer  = table.getTableHeader().getDefaultRenderer();
                      // Rossi: Fix for indexoutofbounds exception: A try catch might be good too?
                      Component         component = renderer.getTableCellRendererComponent(table, "", false, false, 0, table.getColumnCount()-1);
  
                      component.setBounds(0, 0, emptyColumnWidth, table.getTableHeader().getHeight());
  
                      ((JComponent) component).setOpaque(true);
                      CELL_RENDER_PANE.paintComponent(g, component, null, startX, 0, emptyColumnWidth + 1,
                                                      table.getTableHeader().getHeight(), true);
                  }
              }
          };
      }
docs: Creates a {@link Border} that paints any empty space to the right of the
  last column header in the given {@link JTable}'s {@link JTableHeader}.
  
  @param  table DOCUMENT ME!
  
  @return DOCUMENT ME!