Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: JTextField tecknical Q
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JTextField tecknical Q



    • On Dec 12, 2009, at 3:01 PM, elias elias wrote:
    • Hi every Body,
    • i can easly add an action Listener to a JTextField so when I PUCH THE ENTER BUTTON in my Keyboard : a method is called to handel and Does something...
    • But, i don't want ( when I PUCH THE ENTER BUTTON in my Keyboard)
    • i Need instead to call the method each time i LEAVE the JTextField and go to another...
    • in fact, i have 10 JTextFields and when i enter a text into any of them, i need once i leave it (go anywhere out of it) to call this function .....
    • Many Thanks for Any help
    • Subject: Re: JTextField tecknical Q

    • From: email@hidden
    • Date: Sat, 12 Dec 2009 15:28:52 -0600
    • Delivered-to: email@hidden
    • Delivered-to: email@hidden


    I'd recommend using the focusLost() method of a FocusListener:


    myTextField.addFocusListener( new FocusAdapter() {

    public void focusLost(FocusEvent e) {

    doSomething();

    }

    });


    Regards,

     - Jeremy

    -------------------------


    PERFECT, Jeremy


    The above method works well when i leave the JTextField....Good,

    a similar need when i want to doSomething() Not when i leave the JTextField, but each time i TYPE (or Delete) a letter into this  JTextField,

    so i can use it for searches purposes....

    email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.