FileDocCategorySizeDatePackage
GridTFs.javaAPI DocExample742Mon Nov 09 12:45:50 GMT 1998None

GridTFs

public class GridTFs extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    JLabel l1 = new JLabel("Last Name");
    JLabel l2 = new JLabel("Middle Name");
    JLabel l3 = new JLabel("First Name");
    JTextField tf1 = new JTextField();
    JTextField tf2 = new JTextField();
    JTextField tf3 = new JTextField();

    JPanel p = new JPanel();
    p.setLayout(new GridLayout(3, 2, 2, 2)); // ignores preferred size

    p.add(l1);
    p.add(tf1);
    p.add(l2);
    p.add(tf2);
    p.add(l3);
    p.add(tf3);

    JFrame f = new JFrame();
    f.addWindowListener(new BasicWindowMonitor());
    f.setContentPane(p);
    f.pack();
    f.setVisible(true);