×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    7

    how to get the TextFiled events ..

    Hi all..
    I am using LWUIT..
    I am using a textField i want to do something when i click the "clear button" which will come when the text Filed got focus ..

    how to get the event for the clear button ..

    please help me..

    Thanks regards
    Yakub Pasha

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Thumbs up Re: how to get the TextFiled events ..

    Quote Originally Posted by lynxgeek View Post

    how to get the event for the clear button ..

    please help me..

    Thanks regards
    Yakub Pasha
    Make the command with the label as Clear, you can read the more details here,

    Then you can handle the command inside the actionperformed(),
    PHP Code:
        public void actionPerformed(ActionEvent event) {
            if(
    event.getCommand().==clearCommand)
            {
                
    deleteChar();

            }

            } 
    on this command action you have to set the text of the text filed as blank ("").
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    7

    Re: how to get the TextFiled events ..

    thanks for the reply
    what i want is i have a text field when i click on that i am getting two commanda on the screen
    one is "clear" and another is T9
    when i press the clear button its automatically delete the character.
    and i want to add more functionality to that ..

    here is the code i written..

    password = new TextField(){
    protected void fireClicked() {
    System.out.println("Clicked");
    System.out.println("Fields "+password.getComponentForm().getCommandCount());

    //this bloack is not getting executed when i press the clear button.
    password.getComponentForm().addCommandListener(new ActionListener()
    {

    public void actionPerformed(ActionEvent arg0) {
    if(arg0.getCommand()==password.getComponentForm().getClearCommand())
    System.out.println("Clear clicked");
    }

    });

    super.fireClicked();
    }
    };

Similar Threads

  1. not showing full text in the Label of the textfiled in A form
    By kumar.modi in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2010-01-23, 12:45
  2. /Events/
    By sunil sharma007 in forum Automatic Feedback Channel
    Replies: 20
    Last Post: 2009-04-20, 19:28
  3. Replies: 2
    Last Post: 2009-01-21, 05:13
  4. custom textfiled?
    By dakoz in forum Mobile Java General
    Replies: 6
    Last Post: 2006-05-02, 14:14
  5. high-level events VS. low-level events
    By zivgr in forum Mobile Java General
    Replies: 3
    Last Post: 2003-05-14, 16:13

Posting Permissions

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