How to write an AWT application for PalmOs.Zurich 05.02.01
4. How to run the KawtSample program on the Palm Pilot.
1. IntroductionThis How-To explains step by step procedures to write a simple application for PalmOs using AWT features.
To write such an application you'll need:
- JDK 1.3 ww.sun.com
- Visual Age Micro Edition 1.3 - (VAME 1.3) www.embedded.oti.com
- Palm OS runtimes for VAME 1.3 www.embedded.oti.com/download
- kAWT 0.99 (package with the AWT classes adopted to PalmOs) - www.kawt.de (kawt_src.zip)
3. How to install KAWT in VAME?
a) Extract the kawt_src.zip file.
b) Start your VAME 1.3.
c) Open the existing workspace : X:\vame1.3\workspaces\Palm IBM CLDC
d) With a right click , import to the VAME Palm KAWT project following packages/directories:
- kawt\src_de\de
- kawt\src_java\java
- kawt\src_javax\javaxe) Remove following packages:
-de.kawt.shell (shell contains file system dependent classes)
-de.kawt.impl.rim (Needed for Research In Motion Pagers only)
-de.kawt.impl.midp (Required to run kAWT on top of midp only)
-de.kawt.impl.j2se ((still incomplete) RMS implementation for the desktop)
-java.io (it is already included in VAME)
-java.net (it is already included in VAME)f). Remove following files:
-FileList.java
-FileListActivationListener.java
-FileDialog.java
from de.kawt package.g) Add following lines to the jxelink.opt file in VAME Palm KAWT project:
-includeWholeClass de.kawt.impl.kjava.FontMetricsImpl
-includeWholeClass de.kawt.impl.kjava.GifLoader
-includeWholeClass de.kawt.impl.kjava.GraphicsImpl
-includeWholeClass de.kawt.impl.kjava.ImageImpl
-includeWholeClass de.kawt.impl.kjava.LafImpl
-includeWholeClass de.kawt.impl.kjava.RecordStoreImpl
-includeWholeClass de.kawt.impl.kjava.SpotletImpl
-includeWholeClass de.kawt.impl.kjava.ToolkitImpl*VAME has his own kjava package, those lines will include the kAWT kjava implementation
h) Import the following file "KawtSample.java" into the VAME Palm KAWT project:
import java.awt.*;
import java.awt.event.*;
import de.kawt.*;public class KawtSample extends Frame implements ActionListener {
TabbedPane tabPane;
KawtSample () {
super ("This is a simple program");Button exitB = new Button ("Click on the button to exit.");
exitB.addActionListener (this);
exitB.setActionCommand ("exit");tabPane = new TabbedPane();
tabPane.addTab ("Button", exitB);
add ("Center", tabPane);pack ();
}public static void main (String [] argv) {
new KawtSample ().show ();
}public void actionPerformed (ActionEvent e) {
System.exit (0);
validate ();
}
}i) Upload the J9 .prc files to POSE emulator mentioned in point 4 of this documentation.
j) Now you can run the macro runWin.vamemacro and the program will be automaticly uploaded to your Palm OS Emulator.
4. How to run the KawtSample program on the Palm Pilot.
- With a standard Palm Pilot software: "HotSync" "Install" the PalmOS Runtimes (the .prc files) to your Palm Pilot.
Those files contain the J9 Virtual Machine and are all necessary to run the sample or demo.
- With the same install upload to your Palm Pilot the kawtsample.prc file.
- Now you can run the Kawt Sample on your Palm.
- To run kAWT Demo, you have to only import a KawtDemo.java file (instead of mentioned KawtSample.java) , and change in the VAME scripts "kawtsample" to "kawtdemo".
please send te comments to: