/* Simple demo of Jacl, a Java implementation of Tcl. @Copyright (c) 1997 The Regents of the University of California. All rights reserved. Permission is hereby granted, without written agreement and without license or royalty fees, to use, copy, modify, and distribute this software and its documentation for any purpose, provided that the above copyright notice and the following two paragraphs appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. PT_COPYRIGHT_VERSION_2 COPYRIGHTENDKEY */ import tcl.lang.*; import java.awt.*; import java.awt.event.*; import java.applet.*; /** * Simple demo of Jacl, a Java implementation of Tcl. * This applet should produce the string 'Hello World' in * the Java Console window of your browser. */ public class JaclApplet extends Applet { /** * Return a string describing this applet. */ public String getAppletInfo() { return "JaclApplet: Demo of Jacl as an applet.\n" + "By: Christopher Hylands \n " + "(@(#)JaclApplet.java 1.3 02/13/98)"; } public void init () { try { _interp = new Interp(); } catch (Exception e) { System.out.println("JaclApplet: init()" + e); e.printStackTrace(); } } public void paint (Graphics g) { try { if (_interp != null) _interp.eval("puts {Hello world}"); } catch (Exception e) { System.out.println("JaclApplet: paint()" +e); e.printStackTrace(); } } private Interp _interp; }