Animator Project tutorial |
||
STEP 1 Setup |
You should have already installed on your hard drive the JDK from JavaSoft
site. If not downlaod it and follow Sun Instructions. Let's say that your
JDK in under C:.
Let's make a safe copy of the Animator demo sample that you can find under C:. For this, copy all the files from this directory including the subdirectories in a new location like C:. After this operation you should have the following tree C:
|
|
STEP 2 Kawa is up |
Bring Kawa from your Sortcut or directly by calling the program from
your file browser (kawa.exe)
|
|
STEP 3 Project Creation |
If there is already a project opened, select the Project/Close
menu. Now select Project/New menu. The file dialog box appears asking you
to enter a project name. Change first the source directory (Look in:) to
C:. Then enter animator.kawa as the
project name (don't forget the extension .kawa if you are running Win95).
Then press the Open Button
Kawa display the project name in the project view (see below).
|
|
STEP 4 File insertion |
Now that we have created our project, we need to associate any files
to it. It can be HTML, java, C files, ... The animator applets contains
only one .java source file and several HTML files. To Insert files
into your project, select the Project/Add File menu. The file dialog
box appears. Select the .java source file (animator.java) and then press
Open.
Kawa adds the java file under the project name in the project view (see below). Repeat the insert operation by selecting all the HTML files. You would have to select the HTML file type optionlist in the file dialog box. You project window should look like the picture below. A main Animator folder (Project Name), a Animator.java file, and then 5 HTML files.
|
|
STEP 5 Playing with the classes. |
Double-clicking on the Animator.java file in the project list,
open the source file in the editing window. As you can see you have colors
to facilitate your reading. If you clic on the little plus sign on the
left side of Animator.java, Kawa will display the list of classes defined
in the source file.
If you keep pressing the next + sign, you can go further in the object class hierarchy. Kawa displays the methods and the variables for each class. Double clicking on one of the methods or variable will bring you directly in the source file. (the source code would be selected)
|
|
STEP 6 Main selection. |
In order to run you applet you will have to select your main HTML file
that can run your applet.Let's go back in the Project window and use your
right button mouse after selecting the example1.html file. Select
the Main HTML option.
Now you should see in your project window that the example1.html file has a blue square around the bean whic shows your previous selection
|
|
STEP 7 Compilation |
To enable the debugging. You need to compile in Debug mode ! Well,
let's go to the Project/Interpreter Options and make sure the options
(-g) has been selected.
Now, open your source Animator.java file and Press the F7 key (this is a short cut to the Build/Compile menu. Selecting the Build/Rebuild All here as no effect here bacause you have only one source file ! Check out the output window to see the Debug messages. Here there is no error messages ! but most of the cases specially when you try to debug your own applets. You can select from the ouput message the error found by the debugger and Kawa will bring you directly in the source code where the error is. Kawa will open the file if not already opened. For a complete tutorial on How to use the GUI debugger, go to the GUI debugger tutorial.
|
|
STEP 8 Run the applet |
Because we have already selected our Main HTML file, we can press the
F4 key (or the Build/Run menu). Kawa will lunch the appletviewer
(check out the output window) with the Animator applet.
|
Copyright (c) 1996, 1997, WebCetera, WebMaster, Dallas, TX