This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

choice field????  RSS feed

 
raymond yadao
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, how would i make my choice field to behave like the select of html? in html, it has two inputs one for value and another for description.
<select>
<option value="PRO">PROVINCE</option>
<option value="REG">REGION</option>
</select>
how can i do it in choice so that when i select it will return the value(PRO)?in choice field there's a method getSelectedItem(returns the description) and getSelectedIndex(return the index)
thanks....
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raymond,
It is not possible using the AWT Choice component. The Choice component only supports String object therefore you can only use the label displayed as the key to figure out which one was selected.
Regards,
Manfred.
 
raymond yadao
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks...
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!