Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing JTable without border

 
Victor O'Sullivan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to print the contents of a JTable using the JTable.print() method, but I want it to print without the surrounding border na dI can't manage this... any suggestions?

thanks
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://forums.sun.com/thread.jspa?threadID=5340100&tstart=50

the response there seems correct (looking at the code).

copy the source code of TablePrintable(), remove the drawRect(..) line,
and see if it prints borderless.
 
Pavan Kumar Srinivasan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think a better way would be to override the protected printBorder(..) of jtable and customize it to your needs.
 
Pavan Kumar Srinivasan
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just tried it out ..it works fine...overriding printBorder(..) and commenting the call to super.printBorder() , does not paint the border.
 
Campbell Ritchie
Marshal
Posts: 52621
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to JavaRanch ( ), VO'S.
 
Victor O'Sullivan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the prompt replies, and the welcome.

Overriding the super.printborderr method, do you mean to simply do this


I called my print method, JTable.print(), and it still prints the border
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!