×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    20

    Focus to textField by code

    Hi anyone,
    How can I focus the pointer to textField in asha s40 by code??

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    602

    Re: Focus to textField by code

    in LCDUI or LWUIT?
    if LCDUI then i think you cant, if LWUIT then you can using Form.setFocused (i think thats the name of the method )

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    20

    Re: Focus to textField by code

    Yeah, Thanks a lot!

  4. #4
    Nokia Developer Champion
    Join Date
    Aug 2010
    Location
    Ahmedabad
    Posts
    299

    Re: Focus to textField by code

    Quote Originally Posted by tieubinh View Post
    Hi anyone,
    How can I focus the pointer to textField in asha s40 by code??
    YourTextField.setFocus(true);

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    602

    Re: Focus to textField by code

    girishpadia: I'm afraid your mistaken and confusing tieubinh, that is not the correct way to set the focus to a textfield in lwuit.
    Your code will simply put the textfield in a focused style but it wont be the focused component on the Form (i.e. key press will not be sent to it directly)
    The way to achieve that is only via the Form.setFocused(Component c); method

  6. #6
    Registered User
    Join Date
    Dec 2012
    Location
    India
    Posts
    264

    Re: Focus to textField by code

    You can use

    textfieldObject.requestFocus();

Similar Threads

  1. J2ME FUll TOUCH - Open Urdu/Arabic Keypad when Focus is on TextField
    By Shayan Rais in forum Mobile Java General
    Replies: 0
    Last Post: 2013-03-30, 05:24
  2. Setting focus and tabbimg between TextField objects
    By jeffez in forum Mobile Java General
    Replies: 3
    Last Post: 2010-04-10, 19:30
  3. How to check if a TextField has focus
    By ceceboy in forum Mobile Java General
    Replies: 2
    Last Post: 2009-02-23, 16:43
  4. Better Code to focus on Textbox
    By Alicia_S60 in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-11-10, 06:12
  5. loose focus of textfield
    By diplm in forum Mobile Java General
    Replies: 2
    Last Post: 2004-06-16, 15:57

Posting Permissions

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