/* ** FlowExample sample applet ** ** by (c) Copyright 2001 Simon Huggins ** ** For demonstration purposes only. ** ** You may use this applet on your web site, but it cannot be ** sold in either its original or altered state. ** This original notice must be included in all versions of ** the applet distributed, even if altered. ** ** The author accepts no liability for any difficulties or loss ** arising from use of this applet. It is primarily intended for ** demonstration purposes. ** ** Change History ** ~~~~~~~~~~~~~~ ** 07-Oct-2001 v1.0 Release version */ /* ** Import section - tells the compiler where to look for different classes ** used within this file */ import javax.swing.*; import java.awt.*; /* ** Defines a class called FlowExample which takes the basic JApplet ** class as a template, and adds to it to create our Applet. */ public class FlowExample extends JApplet { /* ** Initialize the applet - i.e. set up any values before processing begins */ public void init() { getContentPane().setLayout(new FlowLayout(FlowLayout.LEFT)); // Layout left justified StringBuffer s = new StringBuffer("."); // Create a new string to be added to for (int i=1;i<11;i++) { getContentPane().add(new JLabel("Label "+Integer.toString(i)+" "+s.toString())); getContentPane().add(new JButton("---- Button "+Integer.toString(i)+" ----")); s.append("."); // add another dot to the string } } }