是否有可能在JComboBox中选择多个项目,如果是,如何?如果没有,那么还有另一种方法吗?
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;
}