/* ** 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 (( 07-Oct-2001 v2.0 Increasing Font Size */ /* ** 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 FlowExample2 which takes the basic JApplet ** class as a template, and adds to it to create our Applet. ** Also increases size of the label font size each time around loop. */ public class FlowExample2 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++) { JLabel theLabel = new JLabel("Label "+Integer.toString(i)+" "+s.toString()); theLabel.setFont(new Font("Helvetica",Font.BOLD,10+i)); getContentPane().add(theLabel); getContentPane().add(new JButton("---- Button "+Integer.toString(i)+" ----")); s.append("."); // add another dot to the string } } }