Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Combo Box Output

 
Stacy Eleuterius
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forgive me if this has already been covered, or too elementary to ask!!! I have a input form that I am writing to a file. Included in this form that comtains mainly textfields, I have a combo box. How do I output the selection to a file with all of the other data captured in the textfields?
Thanks in advance.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume that all the items in the JComboBox are String objects here.
You create a String object that will hold the value that was selected in the JComboBox and use it like any String.
String comboBoxSelected = (String)yourComboBox.getSelectedItem();
Hope this helps

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!