• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to stop tableheader from being displayed?

 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
can someone tell me what I'm missing. I'm trying not to display the Table header for my JTable, but it appears to display a little bit of it. Like about 5 pixels worth of Grey area at the top.
Here is mock code - pretend there is real data. I thought it better to give code than to write in words.

The point is I thought the table.getTableHeader().setVisible(false) would work. But it's not make the entire thing invisible.
[ December 17, 2003: Message edited by: Sarone Thach ]
[ December 17, 2003: Message edited by: Sarone Thach ]
 
Bruno Dery
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try maybe table.setTableHeader(null);
 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
tried that too, still display the grey area.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table.setTableHeader(null) is working for me.
If you do not need a JScrollPane, do not use it and you will not see the table header.
This is working anyway...
 
Sarone Thach
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is perfect! thank you Jose!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!