0

Is it possible to select multiple items in a JComboBox if so, how?If not, then is there another way to do this?

private JComboBox getJComboBox1() {
  if (jComboBox1 == null) {
   jComboBox1 = new JComboBox();
   jComboBox1.setModel(new DefaultComboBoxModel(new String[] {"A", "B", "C"}));
   jComboBox1.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent arg0) {

    }
   });
   jComboBox1.setFont(new Font("Verdana", Font.ITALIC, 15));
   jComboBox1.setForeground(Color.red);   
   jComboBox1.setDoubleBuffered(false);
   jComboBox1.setBorder(null);
   jComboBox1.setEnabled(false);
   jComboBox1.setBounds(314, 181, 176, 25);
  }

  return jComboBox1;
 }
Stella
  • 21
  • 4
  • possible duplicate of [JcomboBox multiple selection](http://stackoverflow.com/questions/8471553/jcombobox-multiple-selection) – Stefan Freitag Apr 26 '15 at 05:56
  • The short answer is generally no - or more to the point - not without a lot more work. `JComboBox` was designed to provide selection of a single item, which is displayed within the field – MadProgrammer Apr 26 '15 at 06:00

0 Answers0