×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Show VKB with focus on LWUIT TextArea when form shows

    Hi All!

    How do I make it so that when a form shows up, the VKB shows up with focus on the text area inside the form?

    I tried overriding onShowCompleted and call requestFocus on the textbox like so:

    Code:
    	
    protected void onShowCompleted() {
    	m_input.requestFocus();
    	super.onShowCompleted();
    }
    I also made sure that it got called on the EDT thread but so far, it does not seem to do anything.

    Thanks,
    Jim

  2. #2
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: Show VKB with focus on LWUIT TextArea when form shows

    Add a show listener to the form and call your request focus there.

  3. #3
    Registered User
    Join Date
    Feb 2013
    Posts
    41

    Re: Show VKB with focus on LWUIT TextArea when form shows

    Hmm.. I think I am already doing what you have recommended. See my snippet below. I also tried putting it in onShow().. but no luck. It just would not transfer the focus!

  4. #4
    Regular Contributor
    Join Date
    Dec 2012
    Location
    India
    Posts
    271

    Re: Show VKB with focus on LWUIT TextArea when form shows

    Why is it not working for you?
    Here is what I tried and the focus was automatically sent to the textarea and the VKB showed up.

    Code:
            Display.init(this);
            Form form = new Form();
            final TextArea ta = new TextArea();
            form.addShowListener(new ActionListener()
            {
                public void actionPerformed(ActionEvent ae)
                {
                    ta.requestFocus();
                }
            });
            form.addComponent(ta);
            form.show();

Similar Threads

  1. how to scroll the textarea of lwuit in S40_with_theme
    By vikranttanwar@ in forum Mobile Java UI and User Experience
    Replies: 7
    Last Post: 2013-08-29, 07:44
  2. LWUIT TextArea - edit on focus for non-touch devices?
    By lordbritishix1982 in forum Mobile Java Tools & SDKs
    Replies: 7
    Last Post: 2013-04-30, 17:53
  3. Replies: 2
    Last Post: 2012-11-23, 07:39
  4. LWUIT TextArea Problem
    By zzwei in forum Mobile Java General
    Replies: 4
    Last Post: 2012-09-20, 10:12
  5. [moved] LWUIT Textarea with multilines
    By kenthan in forum Mobile Java General
    Replies: 2
    Last Post: 2012-06-21, 11:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×