Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

JTextField (Java... obvious maby)

Options
  • 04-05-2006 3:42pm
    #1
    Closed Accounts Posts: 521 ✭✭✭


    Is there a way to add an actionlistener to a JTextArea?
    e.g.
    exampleArea.addActionListener(this);

    The above doesnt work though....

    Any help please.


Comments

  • Registered Users Posts: 841 ✭✭✭Dr Pepper


    Not an ActionListener but you could add a KeyListener just as easily which could respond to the 'Enter' key being pressed (which is the same thing as an ActionListener essentially). Only problem with that is the enter key is usually used in a text area to add a newline!! So perhaps you could use ctrl-Enter or alt-Enter to fire your event instead.
    Let me know if you want an example and I'll write some code for you!

    Brian


  • Closed Accounts Posts: 521 ✭✭✭EOA_Mushy


    Cheers man, but no need to write the code. I have seen some thing similar done with the tab key. (Next rather then tab character) Im sure ill be able to modify that.


Advertisement