FileDocCategorySizeDatePackage
EntryLayoutTest.javaAPI DocExample1928Sun Mar 14 13:58:50 GMT 2004regress

EntryLayoutTest

public class EntryLayoutTest extends Object
Testbed for EntryLayout layout manager.
author
Ian Darwin, http://www.darwinsys.com/
version
$Id: EntryLayoutTest.java,v 1.10 2004/03/14 19:58:49 ian Exp $

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] av)
"main program" method - construct and show

		testTwoCols();
		testFiveCols();
	
static voidtestFiveCols()

		final JFrame f = new JFrame("EntryLayout Five Columns");
		Container cp = f.getContentPane();
		double widths[] = { .25, .33, .10, .10, .20 };
		cp.setLayout(new EntryLayout(widths));
		cp.add(new JLabel("Login:", SwingConstants.RIGHT));
		cp.add(new JTextField(10));
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		cp.add(new JLabel("Password:", SwingConstants.RIGHT));
		cp.add(new JPasswordField(20));
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		cp.add(new JLabel("Security Domain:", SwingConstants.RIGHT));
		cp.add(new JTextField(20));
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		cp.add(new JCheckBox());
		f.pack();
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setLocation(200, 200);
		f.setVisible(true);
	
static voidtestTwoCols()

		final JFrame f = new JFrame("EntryLayout Demonstration");
		Container cp = f.getContentPane();
		double widths[] = { .33, .66 };
		cp.setLayout(new EntryLayout(widths));
		cp.add(new JLabel("Login:", SwingConstants.RIGHT));
		cp.add(new JTextField(10));
		cp.add(new JLabel("Password:", SwingConstants.RIGHT));
		cp.add(new JPasswordField(20));
		cp.add(new JLabel("Security Domain:", SwingConstants.RIGHT));
		cp.add(new JTextField(20));
		// cp.add(new JLabel("Monkey wrench in works"));
		f.pack();
		f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		f.setLocation(200, 200);
		f.setVisible(true);