Note: This page is no longer being maintained and
is kept for archival purposes only.|
For current information see our main page.
Developers of custom software and educational simulations.
|Home ... News ... Products ... Download ... Order ... Support ... Consulting ... Company|
StoryHarp & IF
StoryHarp & Java
Generating Java source code for applets to play StoryHarp stories
You can create a Java applet which will allow people to play your StoryHarp story from a web page. This Java applet only supports viewing text in a transcript and clicking on choices. Voice input/output, Agent, sounds, music, and pictures are not currently supported by the applet.
The applet is generated in source code form, which you must then compile using a Java development system. The default source that defines basic player functionality is in the file “Template.java”. When the Java applet generator runs, it reads this file and adds some functions to the end which define the specific story. You may modify the source of the player to add various embellishments as long as you preserve the copyright notices for Kurtz-Fernhout Software.
To create an applet, first load your world into StoryHarp. Then open the world editor window and select Tools | Generate Java. A dialog will appear telling you the complete file name in which the output will be stored. The file name at the end of the path will be called “Story.java”. If you later change the file name, Java requires you to change the class name inside the file as well from “ Story” to whatever the file name is.
For testing purposes, a file “Story.htm” is included which can be used to browse your results. Compiling “Story.java” will produce a file “Story.class” which is what the web page refers to. Copy that HTML file to the compiler output directory.
With a properly configured JDK100 or later from Sun, from the command prompt you would use "javac Story.java" to produce "Story.class". An IDE Java development system like Symantec Cafe may require making a simple project first.
Since the applets generated compile under JDK 1.0, they should run on a wide variety of browsers. If you are an experienced Java developer and you are only supporting JDK 1.1 or later and the latest VMs, you may wish to change the TextArea to do its own word wrapping by setting it to not have a horizontal scroll bar (using the constructor option) after which you can remove the word wrapping code and use a non-proportional font.
Updated: March 10, 1999. Questions/comments on site to firstname.lastname@example.org.
Copyright © 1998, 1999 Paul D. Fernhout & Cynthia F. Kurtz.