SwingListbox extends AbstractSwingContainer implements XulListbox, ListSelectionListener { public Object[] getSelectedItems() { return listBox.getSelectedValues(); } SwingListbox( Element self, XulComponent parent, XulDomContainer container, String tagName ); Object getManagedObject(); boolean isDisabled(); void setDisabled( boolean disabled ); void setDisabled( String disabled ); int getRows(); void setRows( int rowsToDisplay ); String getSeltype(); void setSeltype( String selType ); Orient getOrientation(); void layout(); String getOnselect(); void setOnselect( String onchange ); void valueChanged( ListSelectionEvent e ); Object getSelectedItem(); Object[] getSelectedItems(); void setSelectedItem( Object item ); void setSelectedItems( Object[] items ); void setSelectedIndices( int[] indices ); void addItem( Object item ); void removeItems(); int getRowCount(); int getSelectedIndex(); int[] getSelectedIndices(); void setSelectedindex( String idx ); void setSelectedIndex( int index ); Collection<T> getElements(); void setElements( Collection<T> elements ); String getBinding(); void setBinding( String binding ); String getCommand(); void setCommand( final String command );  }
@Test public void testGetSelectedItems() throws Exception { list.setSelectedIndex( 2 ); XulListitem item = (XulListitem) doc.getElementById( "listItem2" ); Object[] selectedItems = list.getSelectedItems(); assertEquals( 1, selectedItems.length ); assertEquals( selectedItems[0], item ); }