logo
  Custom Print, Page Setup, and Print Preview Dialogs
logo

J2PrinterWorks supports the two standard print dialogs and two standard page setup dialogs made available by the Java JDK.  Java provides for a "native" print dialog and a "native" page setup dialog, which invoke the standard print and page setup dialogs provided by the underlying OS, e.g. Windows, Mac, Unix, etc.  Java also provides for a "cross-platform" print dialog and a "cross-platform" page setup dialog, which are Swing-based dialogs that look essentially the same regardless of the underlying OS platform.  Unfortunately, Java does not provide source code for any of these dialogs, so that if a developer wishes to add or remove features in any of these dialogs, they are unable to do so.  

In addition, Java does not provide any standard print preview dialog, so since its inception J2PrinterWorks has provided a full-featured print preview dialog comparable to the print preview dialogs present in most commercial applications.  However, previously we did not make available the source code for this J2PrinterWorks print dialog (except to Source Code Licensees), so that if a developer wished to add or remove features from the J2PrinterWorks print preview dialog, they were likewise unable to do this.

The J2PrinterWorks 5.0 release has expanded its API sufficiently so that it is now possible to write complete print, page setup, and print preview dialogs entirely using J2PrinterWorks.  To this end, the J2PrinterWorks 5.0 distribution includes sample programs with complete source code for three print dialogs, two page setup dialogs, and two print preview dialogs (one of which is the standard, full-featured J2PrinterWorks print preview dialog).  Any of these may be customized by developers to create print, page setup, and/or print preview dialogs with the features and appearance of their choosing. 


Print dialogs

The sample program J2Printer14SimplePrintDialog includes the class SimplePrintDialog and produces a print dialog that looks as follows:

simple print

The above print dialog requires the use of the class J2Printer14 and JDK 1.4 or later.

Tha sample program J2Printer14TabbedPrintDialog includes the class TabbedPrintDialog and produces a print dialog with three tabbed sections that look as follows:

tabbed print A

tabbed print B

tabbed print C

The above print dialog requires the use of the class J2Printer14 and JDK 1.4 or later.

Tha sample program J2Printer14PrintPlusPreviewDialog includes the class PrintPlusPreviewDialog and produces a print dialog that looks as follows:

preview print

The above print dialog requires the use of the class J2Printer14 and JDK 1.4 or later.


Page Setup dialogs

The sample program J2Printer14SimplePageSetupDialog includes the class SimplePageSetupDialog and produces a page setup dialog that looks as follows:

simple page setup

The above page setup dialog requires the use of the class J2Printer14 and JDK 1.4 or later.

The sample program J2Printer14TabbedPageSetupDialog includes the class TabbedPageSetupDialog and produces a page setup dialog with two tabbed sections that look as follows:

tabbed page setup A

tabbed page setup B

The above page setup dialog requires the use of the class J2Printer14 and JDK 1.4 or later.


Print preview dialogs

The sample program J2PrinterWorksSimplePrintPreviewDialog includes the class SimplePrintPreviewDialog and produces a print preview dialog that looks as follows:

simple print preview

The above print preview dialog can be used with either the J2Printer or J2Printer14 classes and can be used with any JDK 1.2 or later.

The sample program J2PrinterWorksFullPrintPreviewDialog includes the class PrintPreviewDialog that is the same code as is used to implement the built-in J2PrinterWorks full-featured print preview dialog, which produces a print preview dialog that looks as follows:

full print preview

The above print preview dialog can be used with either the J2Printer or J2Printer14 classes and can be used with any JDK 1.2 or later.

© Copyright 2009, Wildcrest Associates (http://www.wildcrest.com)