| Author |
JTableHeader not showing
|
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
This is my first experience using a JTable, and I'm using a DefaultTableModel. What do I need to do to get the header to show? In the test code below, I've gotten to the point of setting the header value (I think), but I'm stuck after that. I'm sure this is something simple, but I'm missing it.
|
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16487
|
|
|
If I'm not mistaken, you only get the column headings if your JTable is in a JScrollPane. Yours isn't, it's in a JPanel that's in the JScrollPane. The intermediate panel looks unnecessary to me.
|
 |
marc weber
Sheriff
Joined: Aug 31, 2004
Posts: 11343
|
|
Sure enough, that seems to be it! Thanks for the help. I broke this out of a much larger piece of code to isolate the problem, and there are a still some unnecessary pieces here. I see I was headed down the wrong path with the code I had in bold.
|
 |
 |
|
|
subject: JTableHeader not showing
|
|
|