craftleft.gif (3002 bytes)QuickTable
Home | API | Tutorial | Download | Support | Contact topblack.gif (108 bytes)


QuickTable User Cp  |  Register  |  Members  |  Search  |  Help
    |- QuickTable Discussion Forums > Release notes Post New Topic   Post A Reply
2.0.5.19 - Added printing support for JDK 1.2 & JDK 1.4 ... printer friendly version
next newest post | next oldest post
Author Messages
Admin
Board Owner

Gender: Unspecified
Location:
Registered: Jul 2003
Status: Offline
Posts: 9

Click here to see the profile for Admin Send email to Admin Send private message to Admin Find more posts by Admin Edit or delete this message Reply w/Quote
Posted Saturday, March 26, 2005 @ 01:10:14  

By default Quicktable uses the basic JDK 1.1 printing, if you want to use the new printing features in java, you can get the Printable object from DBTable using "public java.awt.print.Printable getPrintable(PrintProperties prop)" and use the advanced features.

In JDK 1.2 or 1.3

Code:

//get the printer
java.awt.print.PrinterJob printJob = java.awt.print.PrinterJob.getPrinterJob();

//get the printable object from dbtable
printJob.setPrintable(dbTable.getPrintable(new PrintProperties()));

//show the print dialog, if the user presses print in the dialog, then print
//if you do not want to show dialog, comment the next line and directly call print()
if( printJob.printDialog() )
printJob.print();


In JDK 1.4 or above

Code:

//get the printable object from dbtable
java.awt.print.Printable = dbTable.getPrintable(new PrintProperties());

//set print type
javax.print.DocFlavor flavor = javax.print.DocFlavor.SERVICE_FORMATTED.PRINTABLE;
javax.print.SimpleDoc doc = new javax.print.SimpleDoc(print, flavor, null);

//get printer
PrintService service = PrintServiceLookup.lookupDefaultPrintService();
DocPrintJob job = service.createPrintJob();

//print
job.print(doc, null);

useOldColumnProperties bug

Even if you set useOldColumnProperties(true), still sometimes column models are recreated. This problem is fixed.

Post New Topic   Post A Reply Jump to:
Contact Us | QuickTable - A Java DBGrid | Privacy Policy All times are GMT -5 Hours.
Welcome to QuickTable Forums, Guest!  
Login
Username :
Password :
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!
Powered by CuteCast v2.0 BETA 2
Copyright © 2001-2003 ArtsCore Studios