# Class ComboBox<T>

java.lang.Object
com.codename1.ui.Component
com.codename1.ui.List<T>
com.codename1.ui.ComboBox<T>

All Implemented Interfaces:
  `Animation, Editable, ActionSource, StyleListener`

public class ComboBox<T> extends List<T> implements ActionSource

A `ComboBox` is a list that allows only one selection at a time, when a user clicks the `ComboBox` a popup button with the full list of elements allows the selection of a single element. The `ComboBox` is driven by the list model and allows all the renderer features of the List as well.

The `ComboBox` is notoriously hard to style properly as it relies on a complex dynamic of popup renderer and instantly visible renderer. The UIID for the `ComboBox` is "`ComboBox`" however if you set it to something else all the other UIID's will also change their prefix. E.g. the "`ComboBoxPopup`" UIID will become "`MyNewUIIDPopup`".

The combo box defines the following UIID's by default:

- `ComboBox`

- `ComboBoxItem`

- `ComboBoxFocus`

- `PopupContentPane`

- `PopupItem`

- `PopupFocus`

This class also defines theme constants that allow some native themes to manipulate its behavior e.g.:

- popupTitleBool - shows the "label for" value as the title of the popup dialog

- popupCancelBodyBool - Adds a cancel button into the popup dialog

- centeredPopupBool - shows the popup dialog in the center of the screen instead of under the popup

- otherPopupRendererBool - Uses a different list cell render for the popup than the one used for the `ComboBox` itself. When this is false `PopupItem` & `PopupFocus` become irrelevant. Notice that the Android native theme defines this to true.

iOS doesn't use combo boxes as part of its UI paradigm. Its available there mostly in web applications and feels unnatural in iOS which is why we recommend using the `com.codename1.ui.spinner.Picker` class.

The sample code below uses the `com.codename1.ui.list.GenericListCellRenderer` to create a richer `ComboBox` UI.

    public void showForm() {
      Form hi = new Form("ComboBox", new BoxLayout(BoxLayout.Y_AXIS));
      ComboBox> combo = new ComboBox<> (
              createListEntry("A Game of Thrones", "1996"),
              createListEntry("A Clash Of Kings", "1998"),
              createListEntry("A Storm Of Swords", "2000"),
              createListEntry("A Feast For Crows", "2005"),
              createListEntry("A Dance With Dragons", "2011"),
              createListEntry("The Winds of Winter", "2016 (please, please, please)"),
              createListEntry("A Dream of Spring", "Ugh"));

      combo.setRenderer(new GenericListCellRenderer<>(new MultiButton(), new MultiButton()));
      hi.show();
    }

    private Map createListEntry(String name, String date) {
        Map entry = new HashMap<>();
        entry.put("Line1", name);
        entry.put("Line2", date);
        return entry;
    }

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `POPUP_PLACEMENT_ABOVE`
  Popup placement: always anchor the list directly above the combo box.
  `static final int`
  `POPUP_PLACEMENT_AUTO`
  Popup placement: place the list adjacent to the combo box (default behavior: above when the combo sits in the lower half of the form, below otherwise).
  `static final int`
  `POPUP_PLACEMENT_BELOW`
  Popup placement: always anchor the list directly below the combo box.
  `static final int`
  `POPUP_PLACEMENT_BOTTOM_OF_FORM`
  Popup placement: pin the list to the bottom edge of the form.
  `static final int`
  `POPUP_PLACEMENT_TOP_OF_FORM`
  Popup placement: pin the list to the top edge of the form.

  ### Fields inherited from class List

  `FIXED_CENTER, FIXED_LEAD, FIXED_NONE, FIXED_NONE_CYCLIC, FIXED_NONE_ONE_ELEMENT_MARGIN_FROM_EDGE, FIXED_TRAIL, HORIZONTAL, VERTICAL`

  ### Fields inherited from class Component

  `BASELINE, BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, CROSSHAIR_CURSOR, DEFAULT_CURSOR, DRAG_REGION_IMMEDIATELY_DRAG_X, DRAG_REGION_IMMEDIATELY_DRAG_XY, DRAG_REGION_IMMEDIATELY_DRAG_Y, DRAG_REGION_LIKELY_DRAG_X, DRAG_REGION_LIKELY_DRAG_XY, DRAG_REGION_LIKELY_DRAG_Y, DRAG_REGION_NOT_DRAGGABLE, DRAG_REGION_POSSIBLE_DRAG_X, DRAG_REGION_POSSIBLE_DRAG_XY, DRAG_REGION_POSSIBLE_DRAG_Y, E_RESIZE_CURSOR, HAND_CURSOR, LEFT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NW_RESIZE_CURSOR, RIGHT, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, TOP, W_RESIZE_CURSOR, WAIT_CURSOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ComboBox()`
  Constructs an empty combo box
  `ComboBox(ListModel<T> model)`
  Creates a new instance of ComboBox
  `ComboBox(Object... items)`
  Creates a new instance of ComboBox
  `ComboBox(Vector<T> items)`
  Creates a new instance of ComboBox

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected Dimension`
  `calcPreferredSize()`
  Calculates the preferred size based on component content.
  `protected Dialog`
  `createPopupDialog(List<T> l)`
  Subclasses can override this method to change the creation of the dialog
  `protected List<T>`
  `createPopupList()`
  Creates the list object used within the popup dialog.
  `protected void`
  `fireClicked()`
  When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method in order to allow 3 button devices to work properly.
  `int`
  `getBaseline(int width, int height)`
  The baseline for the component text according to which it should be aligned with other components for best visual look.
  `Image`
  `getComboBoxImage()`
  Gets the ComboBox drop down icon
  `int`
  `getOrientation()`
  Returns the list orientation
  `int`
  `getPopupPlacement()`
  Returns the popup placement mode that controls where `showPopupDialog(Dialog, List)` anchors the list when the combo is tapped.
  `Rectangle`
  `getSelectedRect()`
  Returns the component bounds with absolute screen coordinates, for components that include an internal selection behavior and are not containers (currently only List) this method allows returning the position of the selection itself which is useful for things such as the popup dialog and similar UI's that need to reference the position of the selection externally
  `protected Rectangle`
  `getVisibleBounds()`
  Returns the component bounds for scrolling which might differ from the getBounds for large components e.g.
  `boolean`
  `isActAsSpinnerDialog()`
  When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.
  `static boolean`
  `isDefaultActAsSpinnerDialog()`
  When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.
  `static boolean`
  `isDefaultIncludeSelectCancel()`
  Indicates whethe the soft buttons for select/cancel should appear for the combo box by default
  `boolean`
  `isIncludeSelectCancel()`
  Indicates whethe the soft buttons for select/cancel should appear for the combo box
  `boolean`
  `isShowingPopupDialog()`
  Returns true if the popup dialog is currently showing for this combobox.
  `void`
  `keyReleased(int keyCode)`
  If this Component is focused, the key released event will call this method
  `protected void`
  `laidOut()`
  This is a callback method to inform the Component when it's been laidout on the parent Container
  `void`
  `paint(Graphics g)`
  This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.
  `void`
  `pointerDragged(int x, int y)`
  If this Component is focused, the pointer dragged event will call this method
  `void`
  `pointerHover(int[] x, int[] y)`
  Invoked for devices where the pointer can hover without actually clicking the display.
  `void`
  `pointerHoverReleased(int[] x, int[] y)`
  Invoked for devices where the pointer can hover without actually clicking the display.
  `void`
  `pointerPressed(int x, int y)`
  If this Component is focused, the pointer pressed event will call this method
  `void`
  `pointerReleased(int x, int y)`
  If this Component is focused, the pointer released event will call this method
  `void`
  `setActAsSpinnerDialog(boolean actAsSpinnerDialog)`
  When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.
  `void`
  `setComboBoxImage(Image comboBoxImage)`
  Sets the ComboBox drop down icon
  `static void`
  `setDefaultActAsSpinnerDialog(boolean aDefaultActAsSpinnerDialog)`
  When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.
  `static void`
  `setDefaultIncludeSelectCancel(boolean aDefaultIncludeSelectCancel)`
  Indicates whethe the soft buttons for select/cancel should appear for the combo box by default
  `void`
  `setIncludeSelectCancel(boolean includeSelectCancel)`
  Indicates whethe the soft buttons for select/cancel should appear for the combo box
  `void`
  `setPopupPlacement(int popupPlacement)`
  Controls where the popup list is anchored relative to the combo box or the parent form when the combo is tapped.
  `void`
  `setSelectedIndex(int selection)`
  Sets the current selected offset in the list, by default this implementation will scroll the list to the selection if the selection is outside of the screen
  `void`
  `setSelectedIndex(int selection, boolean scroll)`
  Sets the current selected offset in the list
  `void`
  `setUIID(String uiid)`
  This method sets the Component the Unique identifier.
  `protected Command`
  `showPopupDialog(Dialog popupDialog, List l)`
  Shows the popup dialog for the combo box and returns the resulting command.

  ### Methods inherited from class List

  `addActionListener, addItem, addSelectionListener, animate, fireActionEvent, fireActionEvent, getAccessibilityItemBounds, getAccessibilityItemText, getAccessibilityVisibleItemIndices, getActionListeners, getCurrentSelected, getDragRegionStatus, getFixedSelection, getGridPosX, getGridPosY, getHint, getHintIcon, getItemGap, getListeners, getListSizeCalculationSampleCount, getMaxElementHeight, getMinElementHeight, getModel, getRenderer, getRenderingPrototype, getSelectedIndex, getSelectedItem, getSideGap, initLaf, isCommandList, isDefaultFireOnClick, isDefaultIgnoreFocusComponentWhenUnfocused, isIgnoreFocusComponentWhenUnfocused, isLongPointerPressActionEnabled, isMutableRendererBackgrounds, isNumericKeyActions, isScrollableX, isScrollableY, isSelectableInteraction, isTactileTouch, keyPressed, listSelectionChanged, longPointerPress, modelChanged, paramString, refreshTheme, removeActionListener, removeSelectionListener, scrollRectToVisible, setCommandList, setDefaultFireOnClick, setDefaultIgnoreFocusComponentWhenUnfocused, setFireOnClick, setFixedSelection, setHandlesInput, setHint, setHint, setHintIcon, setIgnoreFocusComponentWhenUnfocused, setInputOnFocus, setItemGap, setListCellRenderer, setListSizeCalculationSampleCount, setLongPointerPressActionEnabled, setMaxElementHeight, setMinElementHeight, setModel, setMutableRendererBackgrounds, setNumericKeyActions, setOrientation, setPaintFocusBehindList, setRenderer, setRenderingPrototype, setScrollToSelected, setSelectedItem, setShouldCalcPreferredSize, shouldRenderSelection, size`

  ### Methods inherited from class Component

  `accessibilityChanged, accessibilityChanged, addContextMenuListener, addDragFinishedListener, addDragOverListener, addDropListener, addFocusListener, addLongPressListener, addMouseWheelListener, addNativeDragOverListener, addNativeDropListener, addPointerDraggedListener, addPointerPressedListener, addPointerReleasedListener, addPullToRefresh, addScrollListener, addStateChangeListener, addStylusListener, announceForAccessibility, bindProperty, blocksSideSwipe, calcScrollSize, canAcceptNativeDrop, cancelRepaints, clearClientProperties, consumesRawTextInput, contains, containsOrOwns, createNativeDragOperation, createStyleAnimation, deinitialize, deinitializeCustomStyle, deregisterFromAnimation, dragEnter, dragExit, dragFinished, draggingOver, dragInitiated, drawDraggedImage, drop, focusGained, focusLost, getAbsoluteX, getAbsoluteY, getAcceptedDropActions, getAcceptedDropMimeTypes, getAccessibilityNode, getAccessibilityText, getAllStyles, getAnimationManager, getBaselineResizeBehavior, getBindablePropertyNames, getBindablePropertyTypes, getBorder, getBottomGap, getBoundPropertyValue, getBounds, getBounds, getClientProperty, getCloudBoundProperty, getCloudDestinationProperty, getComponentForm, getComponentState, getCursor, getDefaultDragTransparency, getDirtyRegion, getDisabledStyle, getDraggedx, getDraggedy, getDragImage, getDragSpeed, getDragTransparency, getEditingDelegate, getHeight, getInlineAllStyles, getInlineDisabledStyles, getInlinePressedStyles, getInlineSelectedStyles, getInlineStylesTheme, getInlineUnselectedStyles, getInnerHeight, getInnerPreferredH, getInnerPreferredW, getInnerWidth, getInnerX, getInnerY, getLabelForComponent, getName, getNativeDragOperation, getNativeOverlay, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getOuterHeight, getOuterPreferredH, getOuterPreferredW, getOuterWidth, getOuterX, getOuterY, getOwner, getParent, getPreferredH, getPreferredSize, getPreferredSizeStr, getPreferredTabIndex, getPreferredW, getPressedStyle, getPropertyNames, getPropertyTypeNames, getPropertyTypes, getPropertyValue, getSameHeight, getSameWidth, getScrollable, getScrollAnimationSpeed, getScrollDimension, getScrollOpacity, getScrollOpacityChangeSpeed, getScrollX, getScrollY, getSelectCommandText, getSelectedStyle, getSemantics, getStyle, getTabIndex, getTensileLength, getTextSelectionSupport, getTooltip, getTopLevelContainer, getUIID, getUIManager, getUnselectedStyle, getVisibleBounds, getWidth, getX, getY, growShrink, handlesInput, hasFixedPreferredSize, hasFocus, hideNativeOverlay, initComponent, initCustomStyle, initDisabledStyle, initPressedStyle, initSelectedStyle, initUnselectedStyle, installDefaultPainter, isAlwaysTensile, isBlockLead, isCellRenderer, isChildOf, isDragActivated, isDragAndDropOperation, isDraggable, isDragRegion, isDropTarget, isEditable, isEditing, isEnabled, isFlatten, isFocusable, isGrabsPointerEvents, isHidden, isHidden, isHideInLandscape, isHideInPortrait, isHScrollThumbGrabbed, isHScrollThumbHover, isIgnorePointerEvents, isInClippingRegion, isInitialized, isNativeDragSource, isNativeDropTarget, isOpaque, isOwnedBy, isPinchBlocksDragAndDrop, isRippleEffect, isRTL, isScrollable, isScrollVisible, isSetCursorSupported, isSmoothScrolling, isSnapToGrid, isStickyDrag, isTactileTouch, isTensileDragEnabled, isTraversable, isVisible, isVScrollThumbGrabbed, isVScrollThumbHover, keyRepeated, longKeyPress, mouseWheel, nativeDragEnter, nativeDragExit, nativeDragOver, nativeDrop, onScrollX, onScrollY, onSetFocusable, paintBackground, paintBackgrounds, paintBorder, paintBorderBackground, paintComponent, paintComponent, paintIntersectingComponentsAbove, paintLock, paintLockRelease, paintRippleOverlay, paintScrollbars, paintScrollbarX, paintScrollbarY, paintShadows, parsePreferredSize, pinch, pinch, pinchReleased, pointerDragged, pointerHoverPressed, pointerPressed, pointerReleased, putClientProperty, refreshTheme, refreshTheme, registerForAnimation, remove, removeContextMenuListener, removeDragFinishedListener, removeDragOverListener, removeDropListener, removeFocusListener, removeLongPressListener, removeMouseWheelListener, removeNativeDragOverListener, removeNativeDropListener, removePointerDraggedListener, removePointerPressedListener, removePointerReleasedListener, removeScrollListener, removeStateChangeListener, removeStylusListener, repaint, repaint, requestFocus, resetFocusable, respondsToPointerEvents, rotation, scrollRectToVisible, scrollRectToVisible, setAcceptedDropActions, setAcceptedDropMimeTypes, setAccessibilityText, setAlwaysTensile, setBlockLead, setBoundPropertyValue, setCellRenderer, setCloudBoundProperty, setCloudDestinationProperty, setComponentState, setCursor, setDefaultDragTransparency, setDirtyRegion, setDisabledStyle, setDraggable, setDragTransparency, setDropTarget, setEditingDelegate, setEnabled, setFlatten, setFocus, setFocusable, setGrabsPointerEvents, setHeight, setHidden, setHidden, setHideInLandscape, setHideInPortrait, setHorizontalScrollBounds, setIgnorePointerEvents, setInitialized, setInlineAllStyles, setInlineDisabledStyles, setInlinePressedStyles, setInlineSelectedStyles, setInlineStylesTheme, setInlineUnselectedStyles, setIsScrollVisible, setLabelForComponent, setName, setNativeDragOperation, setNativeDragSource, setNativeDropTarget, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setOpaque, setOwner, setPinchBlocksDragAndDrop, setPreferredH, setPreferredSize, setPreferredSizeStr, setPreferredTabIndex, setPreferredW, setPressedStyle, setPropertyValue, setPullToRefresh, setRippleEffect, setRTL, setSameHeight, setSameSize, setSameWidth, setScrollAnimationSpeed, setScrollOpacityChangeSpeed, setScrollSize, setScrollVisible, setScrollX, setScrollY, setSelectCommandText, setSelectedStyle, setSize, setSmoothScrolling, setSnapToGrid, setTabIndex, setTactileTouch, setTensileDragEnabled, setTensileLength, setTooltip, setTraversable, setUIID, setUIIDFinal, setUnselectedStyle, setVerticalScrollBounds, setVisible, setWidth, setX, setY, shouldBlockSideSwipe, shouldBlockSideSwipeLeft, shouldBlockSideSwipeRight, shouldRenderComponentSelection, showNativeOverlay, startEditingAsync, stopEditing, stopScrollMomentum, stripMarginAndPadding, styleChanged, toImage, toString, unbindProperty, updateNativeOverlay, visibleBoundsContains`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface ActionSource

  `addActionListener, removeActionListener`

- ## Field Details

  - ### POPUP_PLACEMENT_AUTO

    public static final int POPUP_PLACEMENT_AUTO
    Popup placement: place the list adjacent to the combo box (default behavior: above when the combo sits in the lower half of the form, below otherwise).
    See Also:
      - Constant Field Values

  - ### POPUP_PLACEMENT_ABOVE

    public static final int POPUP_PLACEMENT_ABOVE
    Popup placement: always anchor the list directly above the combo box.
    See Also:
      - Constant Field Values

  - ### POPUP_PLACEMENT_BELOW

    public static final int POPUP_PLACEMENT_BELOW
    Popup placement: always anchor the list directly below the combo box.
    See Also:
      - Constant Field Values

  - ### POPUP_PLACEMENT_TOP_OF_FORM

    public static final int POPUP_PLACEMENT_TOP_OF_FORM
    Popup placement: pin the list to the top edge of the form.
    See Also:
      - Constant Field Values

  - ### POPUP_PLACEMENT_BOTTOM_OF_FORM

    public static final int POPUP_PLACEMENT_BOTTOM_OF_FORM
    Popup placement: pin the list to the bottom edge of the form.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ComboBox

    public ComboBox(Vector<T> items)

    Creates a new instance of ComboBox

    ###### Parameters

    - `items`: set of items placed into the combo box model

  - ### ComboBox

    public ComboBox(Object... items)

    Creates a new instance of ComboBox

    ###### Parameters

    - `items`: set of items placed into the combo box model

  - ### ComboBox

    public ComboBox()
    Constructs an empty combo box

  - ### ComboBox

    public ComboBox(ListModel<T> model)

    Creates a new instance of ComboBox

    ###### Parameters

    - `model`: the model for the combo box elements and selection

- ## Method Details

  - ### isDefaultActAsSpinnerDialog

    public static boolean isDefaultActAsSpinnerDialog()

    When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.

    ###### Returns

    the defaultActAsSpinnerDialog

  - ### setDefaultActAsSpinnerDialog

    public static void setDefaultActAsSpinnerDialog(boolean aDefaultActAsSpinnerDialog)

    When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.

    ###### Parameters

    - `aDefaultActAsSpinnerDialog`: the defaultActAsSpinnerDialog to set

  - ### isDefaultIncludeSelectCancel

    public static boolean isDefaultIncludeSelectCancel()

    Indicates whethe the soft buttons for select/cancel should appear for the combo box by default

    ###### Returns

    true if the soft buttons for select/cancel should appear for the combo box

  - ### setDefaultIncludeSelectCancel

    public static void setDefaultIncludeSelectCancel(boolean aDefaultIncludeSelectCancel)

    Indicates whethe the soft buttons for select/cancel should appear for the combo box by default

    ###### Parameters

    - `aDefaultIncludeSelectCancel`: the new value

  - ### getComboBoxImage

    public Image getComboBoxImage()

    Gets the ComboBox drop down icon

    ###### Returns

    the drop down icon

  - ### setComboBoxImage

    public void setComboBoxImage(Image comboBoxImage)

    Sets the ComboBox drop down icon

    ###### Parameters

    - `comboBoxImage`: the drop down icon

  - ### setUIID

    public void setUIID(String uiid)

    This method sets the Component the Unique identifier. This method should be used before a component has been initialized

    ###### Parameters

    - `id`: UIID unique identifier for component type
    Overrides:
      `setUIID` in class `Component`

  - ### getBaseline

    public int getBaseline(int width, int height)

    The baseline for the component text according to which it should be aligned with other components for best visual look.

    ###### Parameters

    - `width`: the component width

    - `height`: the component height

    ###### Returns

    baseline value from the top of the component

    Overrides:
      `getBaseline` in class `Component`

  - ### laidOut

    protected void laidOut()
    This is a callback method to inform the Component when it's been laidout on the parent Container
    Overrides:
      `laidOut` in class `List<T>`

  - ### getSelectedRect

    public Rectangle getSelectedRect()

    Returns the component bounds with absolute screen coordinates, for components that include an internal selection behavior and are not containers (currently only List) this method allows returning the position of the selection itself which is useful for things such as the popup dialog and similar UI's that need to reference the position of the selection externally

    ###### Returns

    the bounds of the component with absolute screen coordinates

    Overrides:
      `getSelectedRect` in class `List<T>`

  - ### getVisibleBounds

    protected Rectangle getVisibleBounds()

    Returns the component bounds for scrolling which might differ from the getBounds for large components e.g. list.

    ###### Returns

    the component bounds

    ###### See also

    - #getX

    - #getY

    - #getVisibleBounds(com.codename1.ui.geom.Rectangle)

    Overrides:
      `getVisibleBounds` in class `List<T>`

  - ### setSelectedIndex

    public void setSelectedIndex(int selection)

    Sets the current selected offset in the list, by default this implementation will scroll the list to the selection if the selection is outside of the screen

    ###### Parameters

    - `index`: the current selected offset in the list
    Overrides:
      `setSelectedIndex` in class `List<T>`

  - ### setSelectedIndex

    public void setSelectedIndex(int selection, boolean scroll)

    Sets the current selected offset in the list

    ###### Parameters

    - `index`: the current selected offset in the list

    - `scrollToSelection`: @param scrollToSelection indicates whether scrolling to selection should occur if the selection is outside of view

    Overrides:
      `setSelectedIndex` in class `List<T>`

  - ### pointerHover

    public void pointerHover(int[] x, int[] y)

    Invoked for devices where the pointer can hover without actually clicking the display. This is true for PC mouse pointer as well as some devices such as the BB storm.

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerHover` in class `List<T>`

  - ### pointerHoverReleased

    public void pointerHoverReleased(int[] x, int[] y)

    Invoked for devices where the pointer can hover without actually clicking the display. This is true for PC mouse pointer as well as some devices such as the BB storm.

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerHoverReleased` in class `List<T>`

  - ### createPopupDialog

    protected Dialog createPopupDialog(List<T> l)

    Subclasses can override this method to change the creation of the dialog

    ###### Parameters

    - `l`: the list of the popup

    ###### Returns

    a dialog instance

  - ### isShowingPopupDialog

    public boolean isShowingPopupDialog()
    Returns true if the popup dialog is currently showing for this combobox.

  - ### showPopupDialog

    protected Command showPopupDialog(Dialog popupDialog, List l)

    Shows the popup dialog for the combo box and returns the resulting command. This method can be overriden by subclasses to modify the behavior of the class.

    ###### Parameters

    - `popupDialog`: the popup dialog

    - `l`: the list within

    ###### Returns

    the selected command

  - ### fireClicked

    protected void fireClicked()
    When working in 3 softbutton mode "fire" key (center softbutton) is sent to this method in order to allow 3 button devices to work properly. When overriding this method you should also override isSelectableInteraction to indicate that a command is placed appropriately on top of the fire key for 3 soft button phones.
    Overrides:
      `fireClicked` in class `List<T>`

  - ### createPopupList

    protected List<T> createPopupList()

    Creates the list object used within the popup dialog. This method allows subclasses to customize the list creation for the popup dialog shown when the combo box is pressed.

    ###### Returns

    a newly created list object used when the user presses the combo box.

  - ### keyReleased

    public void keyReleased(int keyCode)

    If this Component is focused, the key released event will call this method

    ###### Parameters

    - `keyCode`: the key code value to indicate a physical key.
    Overrides:
      `keyReleased` in class `List<T>`

  - ### pointerPressed

    public void pointerPressed(int x, int y)

    If this Component is focused, the pointer pressed event will call this method

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerPressed` in class `List<T>`

  - ### pointerDragged

    public void pointerDragged(int x, int y)

    If this Component is focused, the pointer dragged event will call this method

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerDragged` in class `List<T>`

  - ### pointerReleased

    public void pointerReleased(int x, int y)

    If this Component is focused, the pointer released event will call this method

    ###### Parameters

    - `x`: the pointer x coordinate

    - `y`: the pointer y coordinate

    Overrides:
      `pointerReleased` in class `List<T>`

  - ### paint

    public void paint(Graphics g)

    This method paints the Component on the screen, it should be overriden by subclasses to perform custom drawing or invoke the UI API's to let the PLAF perform the rendering.

    ###### Parameters

    - `g`: the component graphics
    Specified by:
      `paint` in interface `Animation`
    Overrides:
      `paint` in class `List<T>`

  - ### calcPreferredSize

    protected Dimension calcPreferredSize()

    Calculates the preferred size based on component content. This method is invoked lazily by getPreferred size.

    ###### Returns

    the calculated preferred size based on component content

    Overrides:
      `calcPreferredSize` in class `List<T>`

  - ### getOrientation

    public int getOrientation()

    Returns the list orientation

    ###### Returns

    the list orientation HORIZONTAL or VERTICAL

    ###### See also

    - #HORIZONTAL

    - #VERTICAL

    Overrides:
      `getOrientation` in class `List<T>`

  - ### isIncludeSelectCancel

    public boolean isIncludeSelectCancel()

    Indicates whethe the soft buttons for select/cancel should appear for the combo box

    ###### Returns

    true if the soft buttons for select/cancel should appear for the combo box

  - ### setIncludeSelectCancel

    public void setIncludeSelectCancel(boolean includeSelectCancel)

    Indicates whethe the soft buttons for select/cancel should appear for the combo box

    ###### Parameters

    - `includeSelectCancel`: the new value

  - ### isActAsSpinnerDialog

    public boolean isActAsSpinnerDialog()

    When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.

    ###### Returns

    the actAsSpinnerDialog

  - ### setActAsSpinnerDialog

    public void setActAsSpinnerDialog(boolean actAsSpinnerDialog)

    When this flag is active the combo box acts as a button that opens a dialog that looks like a spinner this allows creating user interfaces for touch devices where a spinner UI approach is more common than a combo box paradigm.

    ###### Parameters

    - `actAsSpinnerDialog`: the actAsSpinnerDialog to set

  - ### getPopupPlacement

    public int getPopupPlacement()

    Returns the popup placement mode that controls where `showPopupDialog(Dialog, List)` anchors the list when the combo is tapped.

    ###### Returns

    one of `POPUP_PLACEMENT_AUTO`, `POPUP_PLACEMENT_ABOVE`, `POPUP_PLACEMENT_BELOW`, `POPUP_PLACEMENT_TOP_OF_FORM`, `POPUP_PLACEMENT_BOTTOM_OF_FORM`.

  - ### setPopupPlacement

    public void setPopupPlacement(int popupPlacement)

    Controls where the popup list is anchored relative to the combo box or the parent form when the combo is tapped. Useful when the default adjacent placement collides with the keyboard, a navigation bar, or the iPhone notch.

    ###### Parameters

    - `popupPlacement`: one of `POPUP_PLACEMENT_AUTO` (default), `POPUP_PLACEMENT_ABOVE`, `POPUP_PLACEMENT_BELOW`, `POPUP_PLACEMENT_TOP_OF_FORM`, `POPUP_PLACEMENT_BOTTOM_OF_FORM`