/** Title: Your Product Name @version: 26 Oct. 1997 Copyright: Copyright (c) 1997 @author: Your Name Company: Your Company Description: Your description */ package untitled1; import java.awt.*; import java.awt.event.*; import java.applet.*; import borland.jbcl.layout.*; import borland.jbcl.control.*; /** Example comment. This will be shown in the documentation file for this class. */ public class Applet1 extends Applet { XYLayout xYLayout1 = new XYLayout(); boolean isStandalone = false; /** Get a parameter value @param key String with key value @param def Definition for key value */ public String getParameter(String key, String def) { return isStandalone ? System.getProperty(key, def) : (getParameter(key) != null ? getParameter(key) : def); } /** Construct the applet */ public Applet1() { } /** Initialize the applet */ public void init() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } /** Component initialization @exception Exception Throws general exception */ public void jbInit() throws Exception{ xYLayout1.setWidth(400); xYLayout1.setHeight(300); this.setLayout(xYLayout1); } /** Start the applet */ public void start() { } /** Stop the applet */ public void stop() { } /** Destroy the applet */ public void destroy() { } /** Get Applet information */ public String getAppletInfo() { return "Applet Information"; } /** Get parameter info */ public String[][] getParameterInfo() { return null; } /** Main method @param args Array of string with parameter values for program */ static public void main(String[] args) { Applet1 applet = new Applet1(); applet.isStandalone = true; DecoratedFrame frame = new DecoratedFrame(); frame.setTitle("Applet Frame"); frame.add(applet, BorderLayout.CENTER); applet.init(); applet.start(); frame.pack(); Dimension d = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2); frame.setVisible(true); } }