: Generate an Applet class and a test page for it
if [ $# -ne 1 ]
then echo Usage: $0 name_of_class
exit 1
else
echo "making test.$1.html..." >/dev/tty
sleep 1
echo '
Test '$1' Applet' >test.$1.html
echo '' >>test.$1.html
echo '
Documentation
' >>test.$1.html
echo 'Source code
' >>test.$1.html
echo 'Byte code
' >>test.$1.html
echo '' >>test.$1.html
echo "making $1.java..." >/dev/tty
echo 'import java.applet.*;'>$1.java
echo 'import java.awt.*;'>>$1.java
echo '/** Started by '$USER' on '`date` >>$1.java
echo '*/' >>$1.java
echo 'public class '"$1"' extends Applet {' >>$1.java
echo '' >>$1.java
echo '/** Things to do when loaded forthe first time: */' >>$1.java
echo ' public void init() {' >>$1.java
echo '' >>$1.java
echo ' }//init' >>$1.java
echo '/** Things to do when restarted: */' >>$1.java
echo ' public void start() {' >>$1.java
echo '' >>$1.java
echo ' }//start' >>$1.java
echo '/** Things to do when finished: */' >>$1.java
echo ' public void stop() {' >>$1.java
echo '' >>$1.java
echo ' }//stop' >>$1.java
echo '' >>$1.java
echo '/** Things to do when the screen needs painting: */' >>$1.java
echo ' public void paint(Graphics g) {' >>$1.java
echo '' >>$1.java
echo ' }//paint' >>$1.java
echo '' >>$1.java
echo ' private final static int SIZE = 300;' >>$1.java
echo ' public static void main(String args[]) {' >>$1.java
echo ' Frame aWindow = new Frame("'$1'");' >>$1.java
echo ' //A window called "'$1'" will hold the Applet' >>$1.java
echo ' '$1' a'$1'Object = new '$1'();' >>$1.java
echo ' //The object that will be put in the window' >>$1.java
echo ' a'$1'Object.init();' >>$1.java
echo ' //a '$1' has now initialized it self' >>$1.java
echo ' a'$1'Object.start();' >>$1.java
echo ' //a '$1' has now started running' >>$1.java
echo '' >>$1.java
echo ' aWindow.add("Center", a'$1'Object);' >>$1.java
echo ' //aWindow now has an '$1' in it' >>$1.java
echo ' aWindow.resize(SIZE, SIZE);' >>$1.java
echo ' aWindow.show();' >>$1.java
echo ' //aWindow is now shown to you (until you CTRL/C)' >>$1.java
echo ' }//main' >>$1.java
echo '}//class '$1 >>$1.java
fi