Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / May 2006

Tip: Looking for answers? Try searching our database.

Printing Rows from JTable

Thread view: 
Manoj Jain - 03 May 2006 09:41 GMT
Hi,
How to print rows from JTable instance on printer. Please suggest the
URL or resources from which i can get information.

Thanks
Thomas Weidenfeller - 03 May 2006 09:55 GMT
> How to print rows from JTable instance on printer. Please suggest the
> URL or resources from which i can get information.

Please check Sun's normal JDK documentation, which is always a good idea
for a start:

http://java.sun.com/j2se/1.5.0/docs/guide/jps/index.html

If that doesn't work, use Google. Which is also always a good idea.

If that doesn't work, search an archive of this group and the other java
groups. That can bring up old discussions on the subject (although,
there shouldn't be many about printing).

Signature

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/

Raja - 09 May 2006 22:02 GMT
Java 1.5 has a method for printing JTable. See JTable.print().
Liz - 17 May 2006 19:10 GMT
Even though JDK 1.5 may have print features, it may not properly split
the pages when the size of the table exceeds the paper size. Also you
may want to add header & footer to the print page, which is not
possible there.

I would suggest to use the free QuickTable java component
(http://quicktable.org) which is an implementation on top of JTable,
which handles all the above issue. QuickTable has simplified printing
by one line methods.

For printing
quiktable.print()

For printpreview (screen shot:
http://quicktable.org/images/printpreview.jpg)
quiktable.printPreview()

To get the printable object
java.awt.print.Printable prn = quicktable.getPrintable(PrintProperties
prop)

If you want to print only few rows from the table, then you need to
first filter the rows and then call quicktable's print method.

Screenshots of other features can be found here.
http://quicktable.org/screenshots.htm


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.