Once you have a correctly running program you will want to print a copy of the program and its output, perhaps because you need to hand it in for credit.
Some printers in the labs are shared among three or four computers. Be sure nobody else is using the printer; then, turn the rotary switch connected to the printer to select your machine. Check that the printer is on and ready.
You can also use NetPrint to print on a laser printer (there is a charge for this). See the CIT documentation for instructions.
Java source programs and other files can be printed from CodeWarrior the same way that text files are printed in a word processor. Select the CodeWarrior window containing the file, then select File|Print.... This brings up the standard print dialog box. If you're using an inkjet or dot-matrix printer, use either Faster or Best quality --Draft quality can be almost illegible. Click Print to print the file.
CodeWarrior can also print part of a file. Select the lines you want to print, then check the Print Selection Only box in the Print... dialog.
Java and its class libraries were designed for use in web applets, which run in a browser, or embedded computers that control gadgets like appliances or smart credit cards. In these environments, there is little need for printed output, and Java provides little direct support for it.
It is, however, possible to get printouts of the console window or a picture of the entire screen indirectly by creating files containing the desired output.
The basic idea is to select the text in the console window and copy it to a text editor, then use the text editor's print command to print it. The output will look best if a monospaced font like Courier or Monaco is used in the text editor.
Macintosh. Select the console window, click at the bottom of the output, and drag the mouse to the top of the window. If text has scrolled off the top of the window, drag the mouse to the window's title bar and hold the mouse button down to scroll the window and select the text. Then select Edit|Copy. Paste the text into an editor window (a new CodeWarrior editor window will do fine) and print it.
Windows. Click the right mouse button on the console window's title bar. Select Edit|Mark from the pop-up menu that appears. Click at the beginning of the text you want to copy, press and hold shift, then click at the end of the text. Click the right mouse button in the title bar again and select Edit|Copy in the popup menu. Click on a text editor window (a new CodeWarrior editor window, for example) and use Edit|Paste to copy the text. Print the window.
Both Macintosh and Windows have the ability to create a file containing a picture of the entire screen. Among other things, this provides a convenient way to print graphics output. First, arrange the windows on the screen so the ones you want to include in the printout are visible, then do the following.
Macintosh. Press Command-Shift-3 to take a snapshot of the screen. The output will be placed in a file named Picture 1 in the main window of the hard disk. If a file named Picture 1 already exists, the file will be named Picture 2, Picture 3, etc.
To view the snapshot, double-click the picture file to launch SimpleText to display the file. To print the snapshot, select File|Print... in SimpleText.
Windows. Press Alt-PrintScrn to take a snapshot of the currently active window, or PrintScrn to take a snapshot of the entire screen. Open Paint from menu Start|Programs|Accessories. Select Edit|Paste to copy the screen image to Paint, then print it.