How To Add Items To ComboBox In Java NetBeans
In This Java Tutorial We Will See How To Add Data From JTextField Or Jcombobox To Another JComboBox On Button Click Using Java Programming Language And NetBeans Editor.
Project Source Code:
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// add item from jcombobox
jComboBox1.addItem(jComboBox2.getSelectedItem().toString());
// add item from jTextField
jComboBox1.addItem(jTextField1.getText());
}
///////////////OUTPUT:
Download Projects Source Code