previous | start | next

## Combo Boxes

- If combo box is editable, user can type own selection
  - Use `setEditable` method
- Add strings with `addItem` method:

      JComboBox facenameCombo = new JComboBox();
      facenameCombo.addItem("Serif");
      facenameCombo.addItem("SansSerif");
      . . .

- Get user selection with `getSelectedItem` (return type is `Object`)

      String selectedString
            = (String) facenameCombo.getSelectedItem();

- Select an item with `setSelectedItem`

previous | start | next