This tutorial will show you how to use some of MultiEd's special features to simplify creating a Java document.
It assumes that the Java SDK has been installed on your computer, that the system has been set up to know where the Java programs are stored. (See Setting up Java , if needed.) It also assumes the tool buttons "Java compile and run" and "Java run" were included when the programmable tools buttons were set up. (See MultiEd's Tool Setup Program, if needed.) They are included in the default setup of MultiEd.
| Selecting the template (The list of available templates will vary.) | |
| The first part of the resulting file. | |
MultiEd will compile your program. After the file compiles correctly, it will try to run it. It detects "extends Applet" in the file and checks to see if can find a corresponding .html or .htm file (Test.html or Test.htm in our example). If it can't, it creates a very simple default file (TestDefault.html in our example). It then load the applet into the Applet Viewer. In this case the applet is blank because we haven't added anything to the basic structure provided by the template.
Hint: You may want to resize your applet or create a web page for it. You can do so by
creating a page Test.html. After you create and save the blank file, you can use an
a template (template-ForApplet.html) to create a simple web page and customize it. You can run the page in the Applet
Viewer by using the "Java run" button while viewing the Java program or in a browser using a web button
while viewing the .html file.
Hint: Java programs require many match pairs of curly brackets { }. The indent lines provide one way to
keep track of them. Another uses the "Find brace" tool. Put the cursor one curly bracket, click the
"Find brace" tool button
and
MultiEd will move the cursor to the matching bracket. The button also works with the pairs ( ),
< >, and [ ].
Hint: If your Java program is long or consists of several files, you may want to create a project. The MultiEd directory contains a subdirectory called "ExampleProject" that illustrates projects. See the MultiEd's Help item "What is a project?" or the Creating and Using Projects Tutorial to learn how to create a project. It is pretty simple.
The following sections explain how to setup Java. They can be skipped if this has already been done.
BE SURE TO READ: the "Installation instructions" provided in a separate link on the download page. Those instructions tell you how to set the "PATH" ENVIRONMENTAL VARIABLE which makes it easy to compile and run Java programs. Make sure you follow the instructions for your version of Windows.
When setting the PATH variable, you should check for an CLASSPATH variable as well. If it already exists, add ".;" to the beginning of it. If not, it may be best to create your own setting CLASSPATH to "." (a period). While this is the default, some programs will set their own CLASSPATH when they are installed and it probably will not include the ".;" term unless it is already there. Note: "." represents the current folder, what ever it may be.
The download page also allows you to download Java Documentation. (This was called "J2SE 5.0 Documentation" when this tutorial was written.) You may find convenient to download it even though it is available on line. It will be easiest if it saved in the folder C:\Program Files\Java\ but this location can be changed as needed.
Return to beginning of the Tutorial
The MultiEd download includes several programmable tool buttons that are useful when working with Java. Four of those are designed especially for Java and have a coffee cup icon.
You can run the ToolSetup.exe program to select the tool buttons you wish to use. Close MultiEd if it is open
before running this program which is in the MultiEd folder. The figure shows 7 tools buttons
that are useful when using Java. The buttons can be assigned to different numbers if desired. Tools 6 and 7
can be used for other purposes and do not have to blank as shown.
Close MultiEd if is open. The top left section shows the available tools and the top middle section shows those that have been installed. To remove an installed tool button, click its left arrow. To assign an available tool, select the tool and then click the right arrow of an unused tool. When you are finished click the close button and say "Yes" when you are asked if you want to save the new setup.
Return to beginning of the Tutorial
Revised Feb. 2, 2006