FileDocCategorySizeDatePackage
TestCompletableJTextField.javaAPI DocExample1200Mon Jan 09 11:02:00 GMT 2006None

TestCompletableJTextField

public class TestCompletableJTextField extends JPanel implements ActionListener

Fields Summary
CompletableJTextField
completableField
JTextField
completionField
Constructors Summary
public TestCompletableJTextField()

        super();
        setLayout (new BoxLayout (this, BoxLayout.Y_AXIS));
        completableField = new CompletableJTextField (75);
        add (completableField);
        JPanel bottom = new JPanel ();
        bottom.add (new JLabel ("Completion:"));
        completionField = new JTextField (40);
        completionField.addActionListener (this);
        bottom.add (completionField);
        JButton addButton = new JButton ("Add");
        addButton.addActionListener (this);
        bottom.add (addButton);
        add (bottom);
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent e)

        completableField.addCompletion (completionField.getText());
        completionField.setText ("");
    
public static voidmain(java.lang.String[] main)

        JFrame f = new JFrame ("Completions...");
        f.getContentPane().add (new TestCompletableJTextField());
        f.pack();
        f.setVisible (true);