|





| |
- If you're working at home, follow the instructions in the syllabus for
installing the compiler and editor software.
- From the Start menu, select Program Files..Textpad. The Textpad
window will open.
- In the Textpad window, select the menu option File..Save As and select the drive you want to store your java
program on:
-
Create a folder to hold your project by clicking the new folder icon:
-
Give the folder a name that will help you remember what it contains. Then
double-click it to open it up.
-
Enter a file name. The name is very important. It must match the
name of the java class you'll be creating. It must also end in .java:

Click save.
-
Enter your program:
-
Save your program by clicking the diskette icon or by selecting the menu option
File..Save or by typing ctrl-S.
-
Compile your program, by selecting menu option Tools..Compile Java:
-
Any compile errors will appear on the textpad screen. Flip back over to
your program and correct them by clicking on your program name in the document
selector window on the left:

(Note: the error in this program was that I named my class Hello, but the file
is named hello. Case is significant in Java. Since class names
should start with a capital letter, I changed my file name so it began with a
capital letter and fixed the error.)
-
Select the Tools..Run Java Applet menu option. The program runs in an
applet window as follows:

In this class, we'll start with applets and move to applications later in the
semester.
-
Close the Applet Viewer window. Save your program again for good
measure. Exit textpad.
-
To run your program another day, locate the program in the windows explorer:

Then, double-click your java program. The first time you do this, you
might receive the "Open With" dialogue box:

Select textpad and check "Always use this program to open this
file." Click OK.
-
To print your program, select the menu option File..Print and, when the printer
dialogue box comes up, click OK.
|