How to use Programmer's File Editor

  1. Using PFE as a text editor
  2. Set up Advanced menu for compile and run Java Program (For Your Computer)
  3. Using the menus
  4. Setting Editor Preferences

1 Using PFE as a text editor

1) There is no setup program for PFE.  You simply need to unzip the file pfe101i.zip. The screenshot below shows the files that will be extracted:

2) To run PFE, simply double click the Pfe32 icon.  The following window will open:

3) Create New file from the File Menu and type your Java source codes in a text file.


2 Set up Execute Menu

You can use PFE simply as an editor to create your source files, as you would use NotePad or WordPad, and still use the JDK tools (javac, java, appletviewer) at the DOS command prompt to compile and run your Java programs.

However, one of the advantages of using PFE over simpler editors is that it allows you to automatically execute DOS commands.  You can configure PFE so that the Execute menu contains the DOS commands you are interested in executing.  To begin with, let's add the javac command to the Execute menu.  This will mean that once we have written our Java source code, we can simply select the javac item from the Execute menu, and our code will automatically be compiled, without us having to go into DOS and type the javac command at the prompt.

2.1 Set up Menu for compile java program

1) First of all, open up the Preferences window, which is found under Options. Choose Options|Preferences  menu.

2) Select Execute Menu

3) Click New Button

4) Type javac in Menu Item text field.

5) Click the button at the end of the command text field to select the command.
For example:   "C:\jdk1.3\bin\javac.exe"
Type %n.java after it

6) Type %u%s%d in the Directory text field.

7) Click ...and Capture Output check box.

8) Click OK button to insert the javac command.

2.2 Set up Menu for running Java Program

1) Click New Button

2) Type java in Menu Item text field.

3) Click the button at the end of the command text field to select the command.
For example: "C:\jdk1.3\bin\java.exe"
Type %n after it

4) Type %u%s%d in the Directory text field.

5) Click ...and Capture Output check box.

6) Click OK button to insert the java command.

2.3 Set up menu for running Java Applet

1) Click New Button

2) Type appletviewer in Menu Item text field.

3) Click the button at the end of the command text field to select the command.
For example: "C:\jdk1.2\bin\appletviewer.exe"
Type %n.html after it

4) Type %u%s%d in the Directory text field.

5) Click ... as independent process check box in Start command

6) Click OK button to insert the java command.


3 Using the Advanced Menus

Now you can execute any of these JDK commands on the currently open window in the editor, simply by going to the Execute menu.

3.1 Compile Java Source Files

1) Select the .java file.

2) Choose Execute|DOS Command to Window...|javac to compile it.

3.2 Running Java Application

1) Select the .java file.

2) Choose Execute|DOS Command to Window...|java to run it.

3.3 Running Java Applet

1) Select the .java file.

2) Choose Execute|DOS Command to Window...|appletviewer to run the applet.


4 Optional: Setting Editor Preferences

You do not need to change the editor preferences if you don't want to, but some of the default preferences are not ideal for writing code.  For example, when writing source code it is very useful if when the return key is pressed, the new line of text starts off being indented by the same amount as the previous line of text.  It is also useful if tabs are displayed as roughly 4 space characters.

Sep up auto-indent and tab spaces

1) To set up this behaviour, select Default Modes... from the Options menu:

2) Click File whose name is not in any mode group check box.

3) Click Edit Modes button.

4) Select Input from the Mode type:.
Click Auto-indent new lines check box.

5) Set up tab spaces
Select Text Formatting from Mode type:.
Change Tab stop every 4 characters