Re: Printing in java



It is really complex to write code for printing JTable. You need to
make sure to handle the cases when the page width & height is larger
than the page size. It is better to go with a custom javabean built
ofr this.

One grid ocntrol which I would suggest is QuickTable. This bean is
built on top of JTable, so you can replace JTable with QuickTable. You
can call the regular Jtable methods with QuickTable.

QuickTable provides printpreview and print methods. You can print
specific pages/subpages using the QuickTable. More information about
free QuickTable grid control can be found at http://quicktable.org

Liz

Thomas Weidenfeller wrote:
raam wrote:
I used an example program to print a page in java.The g.drawString
method is fine when i write simple text.If I try to print a JTable I
could not use this.If I try the print method of JTable it prints one
table per page.How to print more than one table per page.

By scaling/translating the Graphics context appropriately before placing
the tables on the page.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/

.