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();
    }

Loading

Categories: Java Project

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.