> List of tutorials

Table of contents for this tutorial

Base lesson 2, step 6: Print out the report

For this document and all references (links) please obey the hints and regulations concerning copyright, disclaimer and trademarks.

Last revision of this document:
2006-03-03

This step of the tutorial
* reads the content of the TextArea and
* prints the text out to a printer.

Preface:

There is a lot of functionality for printing offered in Java (since Version 1.4).
This tutorial shows a very basic method of printing in Java which will also work with Java Version 1.1 and later
.

Credits:

I took the guideline (in German) for a simple print example from:
http://www.addisonwesley.de/Service/Krueger/kap15004.htm.

Prerequisites:

Code for processing after the click onto button 'Print the report':

As described in steps before, the 'click' leads to a call of the method
protected static void handleEvent(JS_DBLoad parmCallingFrame, ActionEvent parmActionEvent).
To react to a click onto button 'Print the report', a method must be called when the 'ActionCommand' shows a click onto the button,

top.

Print the output in different colors:

As this step did not grew pretty long, there is some nice little extra implemented:
The printed text is colored depending on the kind of information.

top.

Next Step: