FileDocCategorySizeDatePackage
FocusManagerExample.javaAPI DocExample1516Mon Nov 09 12:45:54 GMT 1998None

FocusManagerExample

public class FocusManagerExample extends JPanel

Fields Summary
static MyFrame
frame
Constructors Summary
public FocusManagerExample()


        super();

        frame = new MyFrame("Alphabetized Button Focus Manager");

        setLayout(new GridLayout(6,1));

        JButton button1 = new JButton("Texas");
        JButton button2 = new JButton("Vermont");
        JButton button3 = new JButton("Florida");
        JButton button4 = new JButton("Alabama");
        JButton button5 = new JButton("Minnesota");
        JButton button6 = new JButton("California");

        FocusManager.setCurrentManager(new AlphaButtonFocusManager());

        button1.requestFocus();
        setBackground(Color.lightGray);

        add(button1);
        add(button2);
        add(button3);
        add(button4);
        add(button5);
        add(button6);

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

        FocusManagerExample it = new FocusManagerExample();
        frame.addWindowListener(new BasicWindowMonitor());
        frame.setContentPane(it);
        frame.setSize(200,300);
        frame.setVisible(true);