JDK-6571861 : JTable header can be made shorter than JTable itself
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2007-06-20
  • Updated: 2014-04-02
  • Resolved: 2014-04-02
Related Reports
Relates :  
Description
This bug is opened because of the 
CR 4473075: JTable header rendering problem (after setting preferred size)

Please see the test case from that bug
as you can see setPreferredSize() allows you to have a table header
shorter than a table itself

you set the size for a header, then scroll the table
and after that the header doesn't cover all area above the table

After CR 4473075 is fixed you won't see the garbage on the screen any more
but question is

"Should we allow table header to be shorter then its table ?"
If it is a bug we need to lay it out in respect to the current JTable's width

JDK 7