FileDocCategorySizeDatePackage
DropDownTest.javaAPI DocExample1099Mon Jan 09 11:01:58 GMT 2006None

DropDownTest

public class DropDownTest extends JPanel

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


        final JButton status = new JButton("Color");
        final JPanel panel = new ColorSelectionPanel();
        final DropDownComponent dropdown = new DropDownComponent(status,panel);
        panel.addPropertyChangeListener("selectedColor",new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent evt) {
                dropdown.hidePopup();
                status.setBackground((Color)evt.getNewValue());
            }
        });
        
        
        JFrame frame = new JFrame("Drop Down Test");
        frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
        frame.getContentPane().setLayout(new BorderLayout(  ));
        frame.getContentPane().add("North",dropdown);
        frame.getContentPane().add("Center",new JLabel("Drop Down Test"));
        frame.pack();
        frame.setSize(300,300);
        frame.show();