Huge Collections of Software Manuals and Knowledgebase

GreatManuals.com
Huge Collections of Software Manuals and Knowledgebase

 
Home Contact us Request to publish your help manuals Request to remove your help manuals Buy Now
Introduction
» J2PrinterWorks
» Print Samples and Screen Shots
» Sample Programs and Sample Code
» Installing and Uninstalling
» Pageable and Flowable
Using J2PrinterWorks
» J2Printer
» J2Printer14
» J2PrinterWebStart
» J2TextPrinter
» J2TablePrinter
» J2TreePrinter
» J2ListPrinter
» J2PanelPrinter
» J2ComponentPrinter
» J2FlowPrinter
» Working with HTML
» Utility Classes
» Converting from 1.x
» Class Diagram
» Removed Methods
Support Details
» Known Problems and Bug Reporting
» Frequently Asked Questions
» Technical Support
 
Buy J2PrinterWorks Online! Buy J2PrinterWorks Online!

J2FlowPrinter

Overview

A J2FlowPrinter instance will print one or more Flowables back-to-back either as a Pageable (starting and ending on page boundaries) or as a Flowable (which can be printed back-to-back with other Flowables).

Multiple J2TextPrinter, J2TablePrinter, J2TreePrinter, J2ListPrinter, J2ComponentPrinter, J2PanelPrinter, and even other J2FlowPrinter instances can be intermixed along with HorizontalLine, VerticalGap, and PageEject instances, as well as your own custom Flowables. Each Flowable component within a J2FlowPrinter instance can be separately justified left, right, or center horizontally or top, bottom, or center vertically.

J2FlowPrinter allows you to construct complex documents made up of a series of any of the J2PrinterWorks printing components, such as a rich text document made up of several JTextPane instances, interspersed with instances of JTable, JTree, JList, Component, and JPanel (including Images and drawings), each with their own titles and captions. This feature also allows the individual J2PrinterWorks family products like J2TablePrinter to print more than one table in a document and to surround these with titles, captions, and other smaller content.

The only restriction on the use of J2FlowPrinter is that the same Flowable instance cannot appear twice in the same J2FlowPrinter instance. However, if you need to do this, you can use the J2Printer clone method to create a duplicate copy of such a Flowable.

Programming

You will find it useful to begin your program with:
import com.wildcrest.j2printerworks.*;

rather than spell out the full package name for all J2PrinterWorks classes.

J2FlowPrinter can instantiated with a zero-argument constructor:
J2FlowPrinter flowPrinter = new J2FlowPrinter();

This creates a J2FlowPrinter object and initializes all values to their defaults (see the J2FlowPrinter Javadoc documentation ). To specify the Flowables to be printed by J2FlowPrinter, you can use the following J2FlowPrinter methods:

flowPrinter.setFlowable(oneFlowable); // specifies one (or the first) Flowable to print
flowPrinter.setFlowables(aVectorOfFlowables); // specifies a set of Flowables to print
flowPrinter.addFlowable(oneFlowable); // adds a Flowable to the end of the current list of Flowables
flowPrinter.clearFlowables(); // clears the current list of Flowables

Alternatively, you can use the following single-argument J2TreePrinter constructors:
J2FlowPrinter flowPrinter = new J2FlowPrinter(oneFlowable);
J2FlowPrinter flowPrinter = new J2FlowPrinter(aVectorOfFlowables);

professional data recovery tool best data recovery send bulk sms
digital pictures recovery unerase photos compact flash recovery
unformat usb drive recovery usb media data recovery

The following is a simple but complete Java program (J2FlowPrinterSimplestTest.java) that sets up and prints a J2FlowPrinter:

import java.awt.*;
import javax.swing.*;
import com.wildcrest.j2printerworks.*;

class J2FlowPrinterSimplestTest{

static public void main(String args[]){
System.out.println("\nJ2FlowPrinter test started...");

// set up JTextPane
JTextPane pane = new JTextPane();
pane.setContentType("text/html");
pane.setText("<html>Here are two lines of <b>HTML text</b>"
+ "<br>that <i>will</i> be printed</html>");

// set up JTable
Object[] columns = {"This", "is", "a", "JTable"};
Object[][] data = {{"table", "", "", ""}, {"", "data", "", ""},
{"", "", "goes", ""}, {"", "", "", "here"}};
JTable table = new JTable(data, columns);
JScrollPane scrollPane = new JScrollPane(table);
scrollPane.setSize(new Dimension(250,83));

// set up JTree
JTree tree = new JTree(); // has default content
for (int i=0; i<tree.getRowCount(); i++) tree.expandRow(i);

// set up JPanel
JPanel panel = new JPanel();
panel.add(new JLabel("<html>This text is <i>a JLabel</i>"
+ "<br>displayed inside<font size=5> a JPanel</font></html>"));
panel.setBackground(Color.white);
panel.setPreferredSize(new Dimension(200,50));

»

Buy J2PrinterWorks Online! Buy J2PrinterWorks Online!
Home | Contact Us | Request to publish your help manuals | Request to remove your help manuals