Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Posting combo box to textarea.

 
alexiel davis
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I am hoping that someone can give me a example on how to pass value from combo box to textarea. I have done one..but it doesn't works.


 
Michal Bienek
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to add an ItemListener, not an ActionListener to obtain combo box selection events. You'll need to implement an itemStateChanged(ItemEvent e) method in which you can retrieve the selected combo box value via e.getItem(), and then populate your text area with that.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic