Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no vertical lines in JTableHeader

 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am creating a JTable in which horizontal and vertical lines are visible in JTable rows, but when comes to JTableHeader, vertical lines are not showed.can you please help me regarding vertical lines in JTableHeader.

thank you in advance.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
are you perhaps using a custom renderer for your header?
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using following code but i am unable to get vertical lines in JTableHeader ....

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this, after drawString

g2.drawLine(0,-1,this.getWidth(),-1);
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code works perfectly but the full line not coming for long text.
 
tadi raja
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi michael your logic works fine perfectly, thank you for helping ??

i have a small doubt in JTable, i want to display 10 number of rows, each row contains data(i can retrieve data from web services and displayed in Table cell)in that time i don't need scrollbars for that particular table, because of i am trying to print that table vertical scrollbars are coming in the printed page and aslo inside the vertical scrollbars the data is not showed in printed page..is there any possibility to fix perfect size without using scrollbars for that talbe.thank you in advance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic