0

IDE: NetBeans Windows 7

I am working on my first App. I would like to learn to use Codename One in order to produce applications for my University Course Project next year and would like to become professional at application development.

Could anyone please explain what event I would need and where (text box or combi): Please see the image of my application so far. (need 10 point =/)

The combo box will allow the user to select their activity level and the text box underneath will give an example of the selection. Could someone please share the event and coding that would be required or a link to a tutorial detailing this.

Thanks guys =)

  • Read [this](https://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html) and Refer [this](http://www.javaprogrammingforums.com/awt-java-swing/1357-jcombobox-textfield.html) [this](https://weblogs.java.net/blog/pkeegan/archive/2008/05/binding_jcombob.html) – Madhan Jul 02 '15 at 18:22
  • Go through [this](http://stackoverflow.com/questions/24457607/action-listener-on-combobox-to-display-selection-in-textfield) as well – Madhan Jul 02 '15 at 18:25
  • Thank you. I worked it all out after playing with it. I am starting to get the hang of it now. – Joshua Dowrick Jul 02 '15 at 22:21
  • @Madhan the question was about Codename One not Swing. Confusion is understandable though since Codename One was designed to be very similar to Swing. – Shai Almog Jul 03 '15 at 03:47

1 Answers1

0

Use an action listener to bind the combo box, then then find the text area and use setText(...) to set it to the right value. See: http://www.codenameone.com/how-do-i---handle-eventsnavigation-in-the-gui-builder--populate-the-form-from-code.html

Shai Almog
  • 51,749
  • 5
  • 35
  • 65