This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes no vertical lines in JTableHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "no vertical lines in JTableHeader" Watch "no vertical lines in JTableHeader" New topic
Author

no vertical lines in JTableHeader

tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
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

Joined: Jun 09, 2003
Posts: 4632
are you perhaps using a custom renderer for your header?
tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
i am using following code but i am unable to get vertical lines in JTableHeader ....

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
try this, after drawString

g2.drawLine(0,-1,this.getWidth(),-1);
tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
The code works perfectly but the full line not coming for long text.
tadi raja
Ranch Hand

Joined: Jul 07, 2008
Posts: 109
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no vertical lines in JTableHeader
 
Similar Threads
regarding JTableHeader
The Header Of JTable
JTABLE
JTable Header
JTable cell rendering with no borders