Java JComboBox create

Introduction

The following code shows how to create JComboBox.


constructor:public JComboBox()
usage      :JComboBox comboBox = new JComboBox();

constructor:public JComboBox(Object listData[])
usage      :String labels[] = { "A", "B", "C", "D", "E"};
            JComboBox comboBox = new JComboBox(labels);

constructor:public JComboBox(Vector listData)
usage      :Vector vector = aBufferedImage.getSources();
            JComboBox comboBox = new JComboBox(vector);

constructor:public JComboBox(ComboBoxModel model)
usage      :DefaultComboBoxModel model = new DefaultComboBoxModel();
            model.addElement("CSS");
            JComboBox comboBox = new JComboBox(model);



PreviousNext

Related