I'm in the process of adding a new tab to a tabbed pane in a 12 year old GUI. This tab will, like several other tabs in the tabbed pane, include as one of its components a JPanel containing a JTable mounted in a JScrollPane. Standard stuff, and when I put it together, it all works fine.
What's driving me crazy, is that when I look around the GUI, most of the JTables present have table headers which show up with what I can only assume is the default environment LAF (haven't been able to find any interactions with the UIManager, setting it, anywhere). As below, quite nice:
AltimeterTableHeader.png
When I load my JTable subclass in the JScrollPane, then load that into the JPanel subclass that displays it, everything works fine...but there doesn't appear to be any way in creation that I can get a header that looks like anything other than the Java Tutorials' plainest. As below, functional but drab:
MyTableHeader.jpg
I've spent the past couple of days analyzing code--some parts written in Java 1.2, most in Java 1.4, and now I'm looking to add my material in Java 6--trying to find any consistent similarity or difference between cases presenting metal-LAF vs flat headers, and drawing a complete blank. Sometimes the tables with metal-LAF headers are JTable subclasses (no subclass code relates to headers or rendering, that I can see) and sometimes vanilla JTables. Sometimes (the older instances) have been set up with custom TableSorter code, and most times not--again, none of it seems to affect header rendering. Sometimes custom cell renderers have been applied--the most common setting up alternating grey and white row colours--and sometimes not. And all of these tables seem to have been loaded to standard JScrollPanes. There's some variation in the calls around them, to set viewports, fill viewport heights, and so on, but again, nothing that seems to touch header rendering.
And of course there isn't a tutorial in sight anywhere, that offers any clues as to how the default-LAF headers might be showing up.
Can anyone point me in the direction of what, between one case of table-in-scrollpane-in-panel, and the next, might play a part in determining JTableHeader LAF?