FileDocCategorySizeDatePackage
BordLayDemo.javaAPI DocExample994Sat Nov 25 12:55:10 GMT 2000None

BordLayDemo

public class BordLayDemo extends Frame
BorderLayout demo. Also shows off BitSet class from java.util.

Do not assume from this demo that BorderLayout forces e.g., East and West to be same width, or North and South to be same height. See BorderLayDemo2 for counter examples.

Fields Summary
String[]
cp
static final int
NORTH
static final int
EAST
static final int
SOUTH
static final int
WEST
static final int
CENTER
Constructors Summary
BordLayDemo(String s, BitSet b)


	    
		super(s);
		setLayout(new BorderLayout());
		for (int i = 1; i<=5; i++)
			if (b.get(i))
				add(cp[i], new Button(cp[i]));
		pack();
		setVisible(true);
	
Methods Summary
public static voidmain(java.lang.String[] av)

		BitSet b = new BitSet();
		b.set(NORTH);
		b.set(EAST);
		b.set(SOUTH);
		b.set(WEST);
		b.set(CENTER);
		new BordLayDemo("All", b);

		b.clear(CENTER);
		new BordLayDemo("Compass", b);

		b.set(CENTER);
		b.clear(NORTH);
		b.clear(SOUTH);
		new BordLayDemo("Horizontal", b);