• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do you use JComboBox addItem(Object)  RSS feed

 
Dar Var
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to add name:value pairs to a JComboBox. The value is what appears.

How can I add them and how can I get the selected name:value pair back?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Combo Tutorial - answers your questions.
 
Dar Var
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do I have to use MutableComboBoxModel?

Could you possibly give me a code snippet. I cannot find what I'm looking for in this Tutorial
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what do you mean by value pair?

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
simple demo (in this name appears, click a name to get the value)

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