Java Reference
In-Depth Information
To Print the Source Code
1. Ready the printer according to the printer instructions. With the
Welcome.java source code displaying in the TextPad window, click the
Print button in the Standard toolbar (see Figure 2-40 on page 85).
2. When the printer stops, retrieve the printout.
TextPad prints a hard copy of the Java source code (Figure 2-42). Your print-
out may differ.
Welcome.java
10/4/2007
1
/*
2
Chapter 2:
Welcome to My Day
3
Programmer: J. Starks
4
Date:
October 4, 2007
5
Filename:
Welcome.java
6
Purpose:
This project displays a welcome message, the user's
7
name, and the system date in a console application.
8
*/
9
10
import java.util. Date ;
11
12
public class Welcome
13
{
14
public static void main ( String [] args )
15
{
16
Date currentDate = new Date () ; // Date constructor
17
System .out.println () ;
18
System .out.println ( "\t\t\tWelcome to my day!" ) ;
19
System .out.println ( "\t\t\tDaily planner for Linda Nunez" ) ;
20
System .out.println ( "\t\t\t" + currentDate ) ;
21
System .out.println () ;
22
}
23
}
FIGURE 2-42
OTHER WAYS
When you use the Print button to print source code, TextPad prints the
entire listing automatically. If your printout does not display line numbers, you
may turn the feature on in the Preferences dialog box as discussed in Appendix
C. You then can distribute the hard copy or keep it as permanent documentation
of the source code for the Welcome to My Day application.
If you want to print multiple copies of the document, click File on the menu
bar and then click Print to display the Print dialog box. The Print dialog box has
several printing options, including the option to specify the number of copies to
print.
1. On File menu, click
Print, click OK
button
2. Press CTRL + P , click
OK button
Quitting TextPad
After you create, save, compile, execute, test, and print the program, you can quit
TextPad. To quit TextPad and return control to Windows, perform the following
step.
Search WWH ::




Custom Search