FileDocCategorySizeDatePackage
Utilities.javaAPI DocExample1576Tue Dec 12 18:58:44 GMT 2000bingo.shared

Utilities

public class Utilities extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidaddParameterRow(java.awt.Container container, javax.swing.JLabel label, java.awt.Component component)
Add a label-value pair to a container that uses GridBagLayout.

        GridBagLayout gridbag = null;
        try {
            gridbag = (GridBagLayout)(container.getLayout());
        } catch (Exception e) {
            System.err.println("Hey!  You called addRow with"
                               + " a container that doesn't "
                               + " use GridBagLayout!");
            return;
        }

        GridBagConstraints c = new GridBagConstraints();
        c.fill = GridBagConstraints.HORIZONTAL;
        //c.weighty = 1.0;
        c.insets = new Insets(0, 5, 0, 5);

        gridbag.setConstraints(label, c);
        container.add(label);
        c.gridwidth = GridBagConstraints.REMAINDER;
        c.weightx = 1.0;
        gridbag.setConstraints(component, c);
        container.add(component);
    
public static javax.swing.BoxmakeEvenlySpacedBox(javax.swing.JComponent[] compList)
Create a horizontal Box and add a group of evenly spaced JComponents to it.

	Box box = Box.createHorizontalBox();
	int numComponents = compList.length;
        int i = 0;

        while (i < numComponents) {
            box.add(Box.createGlue());
            box.add(compList[i++]);
        }
        box.add(Box.createGlue());
	return box;