Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String[] petStrings = { "Bird", "Cat", "Dog", "Rabbit", "Pig" };
- //Create the combo box, select item at index 4.
- //Indices start at 0, so 4 specifies the pig.
- JComboBox petList = new JComboBox(petStrings);
- petList.setSelectedIndex(4);
- petList.addActionListener(this);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement