SwingMenuList extends AbstractSwingContainer implements XulMenuList<T> { public String getSelectedItem() { if ( editable ) { return textComp.getText(); } return ( (SwingMenuitem) this.combobox.getModel().getSelectedItem() ).getLabel(); } SwingMenuList( Element self, XulComponent parent, XulDomContainer domContainer, String tagName ); void layout(); void onDomReady(); SwingMenupopup getPopupElement(); @Deprecated void replaceAllItems( Collection<T> tees ); String getSelectedItem(); void setSelectedItem( T t ); void setOncommand( final String command ); Collection<T> getElements(); String getBinding(); void setBinding( String binding ); void setElements( Collection<T> tees ); int getSelectedIndex(); void setSelectedIndex( int idx ); @Override void setWidth( int width ); void setEditable( boolean editable ); boolean getEditable(); String getValue(); void setValue( String value );  }
@Test public void testGetSelectedItem() throws Exception { XulMenuitem item = (XulMenuitem) doc.getElementById( "regions" ); assertEquals( list.getSelectedItem().toString(), item.getLabel() ); }