Up Next
Go up to Top
Go forward to Getting Started

Metrowerks Background

As one divides books into sections and chapters, a Java applet can be divided up into several files of instructions to the computer and each file is further subdivided into short groups of instructions called "methods". The Metrowerks software we will be using this semester enables you to work with such files of Java methods in several ways.

First, just as we used PageSpinner to enable us to enter and edit the text of HTML files, we will use Metrowerks to enter and edit the text of Java applets. The Metrowerks editor knows the rules of the Java language's grammar. Using this knowledge, it will format your program to make it more readable somewhat as PageSpinner formatted HTML text. Metrowerks, however, does not provide lots of menu items for inserting pieces of Java code. Most of your code will be entered by simply typing.

Second, before a computer can follow the instructions you write in an applet, they must be translated from Java into a more primitive language the computer can interpret more readily. Metrowerks performs this translation process. It is in this more primitive language, known as Java Virtual Machine code, that your applet will actually be sent through the Internet to remote browsers.

Finally, while Java applets are ultimately designed to be included in web pages where the instructions they contain can control the information presented in a browser's window, Metrowerks provides a way to test your applet by previewing the way it will behave without using a browser.

In order to perform all these functions, Metrowerks needs to keep track of many files. First, there is the file or files in which you place your Java instructions. Second there are the files in which the results of translating your applet into Java virtual machine code are stored. These are called Java archive or ".jar" files. In addition, there may be pre-written java code or class files an applet relies on.

To keep track of all these files, Metrowerks depends on yet another file called the "project" file. Within this file Metrowerks stores all the information it needs to find the other files together with information about their current condition. You will almost always start Metrowerks by double-clicking on a project file. This enables it to easily find all the files needed for your applet.

To make it easy to get your Java files and project file organized correctly in the first place, we will typically give you a folder containing skeletal versions of all the files you need and then let you "fill in the blanks". You will, however, need to be careful when working with these folders. If you change the name of a file by clicking on its icon and typing a new name, this change won't be reflected in the Metrowerks project file. The next time you double-click on the project file, Metrowerks won't be able to figure out where the file you renamed went. Accordingly, the safest thing to do until you become quite expert at working with Metrowerks is to avoid renaming, deleting or adding files within a project folder.


Up Next