(keitai-l) ListBox requestFocus()

From: Chris <crza_at_gmx.net>
Date: 07/29/03
Message-ID: <3F268A4F.80707@gmx.net>
Hi,

I'm developing a simple menu-based doja 1.5 application on an nec n31i
imode. I have problems with UI and focussing when using a ListBox.

I create a ListBox, fill it, and select the first item, then i add
it to the panel and requestFocus(), so that the user can directly change
the options.

But when i start the application the menu is not focussed and i have to
select the box  before i can change the selected option. What am i doing
wrong? Any help appreciated, here's my code:

snipp -----------------------------------------
    ListBox lb = new ListBox ( ListBox.NUMBERED_LIST );
    Enumeration enum = linkLabels.elements();

    // fill items from Array
    int i = 0;
    items = new String [ linkLabels.size() ];

    while ( enum.hasMoreElements() ) {

      items[i] = ( String ) enum.nextElement();
      i++;
    }
    setTitle ( screenTitle );
    setSoftKeyListener ( this );
    setComponentListener ( this );

    lb.setItems ( items );
    this.add ( lb );

    lb.setEnabled ( true );
    lb.select ( 0 );
    lb.requestFocus();
--------------------------------------------->

thx,

chris
Received on Tue Jul 29 17:58:31 2003