I have a situation with a table that's narrower and shorter than the enclosing scroll pane's viewport, and column auto-resizing is turned off, so there's empty space below and to the right of the table. I'd like to fill the empty space with a single background color. I can fill in the bottom using scrollPane.setBackground(), and I can set most of the right side using scrollPane.getViewport().setBackground(). But I'm still left with an uncolored strip to the right of the table's column headers. I've tried using setBackground on the scroll pane's enclosing panel, and also tried using scrollPane.setColumnHeaderView() to force a new colored JPanel, but neither method has worked.
Is there any way to fill in that strip right of the table's column headers?
Below is the code I'm using, a slight variation of TableDemo.java from Oracle's Swing Example set.
Thanks in advance for any help. - Dennis