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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

JTextField (Java... obvious maby)

  • 04-05-2006 2: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, Registered Users 2 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