package com.drbob42.jbjar.tip23; import java.awt.*; import java.awt.event.*; import java.applet.*; import borland.jbcl.layout.*; import borland.jbcl.control.*; import borland.jbcl.view.*; public class SpacerApplet extends Applet { private SpacerFrame frame; FlowLayout flowLayout1 = new FlowLayout(); Button startFrameButton = new Button(); Label label1 = new Label(); Spacer spacer1 = new Spacer(); public SpacerApplet() { } public void init() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { startFrameButton.setLabel("Show test frame"); startFrameButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { startFrameButton_actionPerformed(e); } }); label1.setText("Press the button to show a frame with a Spacer sample"); spacer1.setPreferredSize(new Dimension(20, 10)); this.setSize(new Dimension(484, 40)); flowLayout1.setHgap(2); flowLayout1.setAlignment(0); flowLayout1.setVgap(2); this.setLayout(flowLayout1); this.add(startFrameButton, null); this.add(spacer1, null); this.add(label1, null); } public String getAppletInfo() { return "Applet Information"; } public String[][] getParameterInfo() { return null; } void startFrameButton_actionPerformed(ActionEvent e) { if (frame == null) { frame = new SpacerFrame(); } frame.validate(); frame.setVisible(true); } }