// Example over-extended combo box.
//
// CS 310, Spring 2008
import javax.swing.JComboBox;
import javax.swing.JApplet;
import javax.swing.JPanel;
// <applet
// code = "statecombobox" archive = "swingc.jar" height = 25 width = 250>
// </applet>
public class
statecombobox
extends JApplet {
@Override
public void
init() {
final JPanel panel = new JPanel();
add(panel);
final JComboBox comboBox = new JComboBox();
comboBox.setEditable(true);
for (String s: StateNames.stateNames)
comboBox.addItem(s);
panel.add(comboBox);
}
}
syntax highlighted by Code2HTML, v. 0.9.1