• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why JTable Header Missing?????????  RSS feed

 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why dose a JTable's Header not show up if you add the table to a JPanel but if you add it to a JScrollPane first it shows???
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because that's how a header usually behaves... the headers remain fixed at the top of the table and the data can scroll below... why not use a JScrollPane instead of a JPanel?
 
Ronnie Phelps
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I noticed that I have to use a JScrollPane but I just wanted to know why. Your explanation makes sense. Thanks dude.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!