Java Add Values To JComboBox

How To Add Items To ComboBox In Java NetBeans 

add item to jcombobox in java

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:

add item to jcombobox





Share this

Related Posts

Previous
Next Post »