Example : How to add values in combo box using property window.
Select the Combo Box-'Properties Window'-choose 'Model' and click on browse button(...)-Enter the values.
Example : How to add values in combo box using codes.
public UserRegistrion()
{
initComponents(); //java's load event
jComboBox1.addItem("Select Anyone Item");
jComboBox1.addItem("Item1");
jComboBox1.addItem("Item2");
jComboBox1.addItem("Item3");
jComboBox1.addItem("Item4");
}
Example : How to open Combo box list data automatically on gaining focus on it.
private void jComboBox1FocusGained(java.awt.event.FocusEvent evt)
{
// TODO add your handling code here:
jComboBox1.showPopup();
}
0 Comments