• Post Reply Bookmark Topic Watch Topic
  • New Topic

TextArea and ActionEvent  RSS feed

 
paul wheaton
Trailboss
Posts: 22261
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the story with TextArea and ActionEvent?
Does TextArea gobble up all ActionEvents?
Is this sort of thing pretty rare?
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JTextArea and TextArea doesn't listen for
action listeners at all. addActionListener
is not part of TextComponent or JTextComponent, it is available only in TextField or JTextField.
 
paul wheaton
Trailboss
Posts: 22261
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since posting this I have figured out why.
With TextField, the action is if the user presses ENTER. But in TextArea, ENTER is used to store a new line character.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!