FileDocCategorySizeDatePackage
GridBag3.javaAPI DocExample647Sun Mar 02 02:42:42 GMT 1997None

GridBag3

public class GridBag3 extends Applet

Fields Summary
GridBagConstraints
constraints
Constructors Summary
Methods Summary
voidaddGB(java.awt.Component component, int x, int y)


	          
		constraints.gridx = x;  constraints.gridy = y;
		add ( component, constraints );
	
public voidinit()

		setLayout( new GridBagLayout() );
		constraints.fill = GridBagConstraints.BOTH;
		constraints.weighty = 1.0;

		int x, y; // for clarity
		constraints.weightx = 0.1;
		addGB( new Button("one"), 	x=0, y=0 );
		constraints.weightx = 0.5;
		addGB( new Button("two"), 	++x, y );
		constraints.weightx = 1.0;
		addGB( new Button("three"), ++x, y );