(keitai-l) Re: Problem in DoJa??

From: Jason Pollard <jasonpollard_at_yahoo.com>
Date: 12/19/03
Message-ID: <20031219011105.71991.qmail@web9902.mail.yahoo.com>
Although I don't have the docs in front of me now, I think that you need to
register some sort of event Listener for your menus.  I think you can make your
Panel implement ComponentListener, so when the ListBox event is fired, the
class can respond as you wish, i.e. Display.setCurrent.  You can see the UIDemo
which ships with most j2me packages for an example.

Sorry for the vague explanation.  If you need a better explanation, send me a
mail offline.

--Jason


--- "Reugene ." <funk_docta_nl@hotmail.com> wrote:
> I'm busy making a menu in "Doja" I'm using a reference to help me, but I'm 
> stuck and I have no idea how to continue. I put a menu in both of the 
> classes. What I want to do is: if you click on options in the first 
> menu(located in the first class) you go to the options menu(located in the 
> second class). I know that I have to use the getSelectedIndex method, but 
> how???
> 
> Can somebody give me a tip on how to do this?
> 
> 
> 
> 
> 
> 
> 
> This is a simplefied version of the code:
> 
> import com.nttdocomo.ui.*;
> 
> public class Test extends IApplication
> {
>   private HoofdMenu hoofdMenu;
>   private OptionsMenu optionsMenu;
> 
> 
>   public Test()
>   {
>     hoofdMenu = new HoofdMenu( "Main Menu" );
>     optionsMenu = new OptionsMenu( "Options" );
>   }
> 
>   public void start()
>   {
>     Display.setCurrent(  hoofdMenu );
>   }
> }
> 
> 
> 
> 
> //Dit is de klasse van het hoofdmenu
> class HoofdMenu extends Panel
> {
>   private ListBox main;
> 
>   public HoofdMenu( String titel )
>   {
>     setTitle( titel );
> 
>     main.append( "Options" );
>     main.append( "Exit" );
>     main.getSelectedIndex();
> 
>     add( main );
>   }
> }
> 
> 
> 
> //Dit is de klasse van het optionsmenu
> class OptionsMenu extends Panel
> {
>   private ListBox options;
> 
>   public OptionsMenu( String titel )
>   {
>     options = new ListBox( ListBox.SINGLE_SELECT, 4 );
>     options.append( "Geluid" );
>     options.append( "Trilfunctie" );
> 
>     add( options );
>   }
> }
> 
> _________________________________________________________________
> MSN Zoeken, voor duidelijke zoekresultaten! http://search.msn.nl
> 
> 
> This mail was sent to address jasonpollard@yahoo.com
> Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ 
> 


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/
Received on Fri Dec 19 03:14:05 2003