Current Page:
NeXtMidas Training
Applets & WebStart
Applets Lab
Instructions
|
|
- Lab 1:
- For this lab you will turn the macro you wrote for Lab 3 in the
Macros - Part 2 (Graphics) module into an applet.
- What you need to do:
- Start by copying the the sample Applet page
$NMROOT/htdocs/nm-terminal.html
to your home directory (you will need to right-click on the link and select
"Save Link As..." otherwise it will load the applet). Save the page as
xxx_applet.html substituting your initials for xxx .
- Edit the page to change the codebase to the relative location of your
$NMROOT (this will probably be as simple as "nxmxxx"
if NeXtMidas is installed under your home directory.
- Append "
,jars/nxm-train.jar " to the archive= attribute in the applet tag. e.g.
<applet codebase="nxmxxx" archive="jars/nxm-sys.jar,jars/nxm-train.jar" code=...>
- Build the
nxm-train.jar JAR file. You can do this by running...
nM> make jars train
- Load the page in your web browser. It should run a NeXtMidas terminal in
the web browser.
- Now edit the
.html page again...
- Add a
param definition for "OPTS" that includes
your option tree. e.g.
<param name="OPTS" value="TRAIN,SYS">
- Change the value of the
"WIN" param tag to be "APPLET_WIN"
- Change the value of the
"CMD" param tag so that it runs your macro
(APPLETLAB ) with a /WIN.PANEL=APPLET_WIN switch. This tells the PANEL
to attach itself to the applet window.
- Reload (e.g. control-refresh) the page in the browser. You should now see your macro running embedded in the
browser.
- NOTE: You may want to add code to the appletlab.mm macro to allow the
"Exit" button to be disabled
since the applet exits when the browser window exits. (For example, you can just
skip the GCONTROL BUTTON line if the /APPLET switch is set.)
Don't Make This Mistake: |
Remember that there are a number of security restrictions on running applets. If you just
used your solution to Lab 3 and it was setup to plot maps from a map server,
it won't work!
|
|
|
|