<s> """<STR_LIT>""" <EOL> from pyjamas . ui . SimplePanel import SimplePanel <EOL> from pyjamas . ui . HorizontalPanel import HorizontalPanel <EOL> from pyjamas . ui . ListBox import ListBox <EOL> from pyjamas import Window <EOL> class ListBoxDemo ( SimplePanel ) : <EOL> def __init__ ( self ) : <EOL> SimplePanel . __init__ ( self ) <EOL> hPanel = HorizontalPanel ( ) <EOL> hPanel . setSpacing ( <NUM_LIT:10> ) <EOL> self . list1 = ListBox ( ) <EOL> self . list1 . setVisibleItemCount ( <NUM_LIT:10> ) <EOL> self . list1 . addItem ( "<STR_LIT>" ) <EOL> self . list1 . addItem ( "<STR_LIT>" ) <EOL> self . list1 . addItem ( "<STR_LIT>" ) <EOL> self . list1 . addChangeListener ( getattr ( self , "<STR_LIT>" ) ) <EOL> self . list2 = ListBox ( ) <EOL> self . list2 . setVisibleItemCount ( <NUM_LIT:1> ) <EOL> self . list2 . addItem ( "<STR_LIT>" ) <EOL> self . list2 . addItem ( "<STR_LIT>" ) <EOL> self . list2 . addItem ( "<STR_LIT>" ) <EOL> self . list2 . addChangeListener ( getattr ( self , "<STR_LIT>" ) ) <EOL> hPanel . add ( self . list1 ) <EOL> hPanel . add ( self . list2 ) <EOL> self . add ( hPanel ) <EOL> def onList1ItemSelected ( self , event ) : <EOL> item = self . list1 . getItemText ( self . list1 . getSelectedIndex ( ) ) <EOL> Window . alert ( "<STR_LIT>" + item + "<STR_LIT>" ) <EOL> def onList2ItemSelected ( self , event ) : <EOL> item = self . list2 . getItemText ( self . list2 . getSelectedIndex ( ) ) <EOL> Window . alert ( "<STR_LIT>" + item + "<STR_LIT>" ) </s>
