email me at borlaj@portlandschools.org

Loading
notes previous (10/<10) submit the dump links  
 

Combobox

 

Key to a combox, to declare it:

 
String course[] = {"BCA","MCA","PPC","CIC"};            
JComboBox combo=new JComboBox(course); 
            

To get the selected item you will say:

String selectedValue=(String)combo.getSelectedItem();            
            

If you wanted to add values (numbers 1-10 to the combobox:

             
		someComboBox = new JComboBox();
        for (int i=0;i<10;i++) {
            someComboBox.addItem(i+"");
        }