• Post Reply Bookmark Topic Watch Topic
  • New Topic

adding items to jcombo box

 
Maha Hassan
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried to add items using ad item to a j combo box but it didnt work
so how can i do it
and what is missing ??
 
Deepak Deshpande
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most simple form of creating the jcombox is have a vector with collection of items (normally string objects to be shown in the combobox)and create a jcombox using the vector constructor as

JComboBox(Vector items)


Hope it may help you

Thanks
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maha Aburahma:

... and what is missing ??


It's difficult to see what is missing when we can't see what you've got. Post your code and I'm sure someone will point out your problem.
 
Maha Hassan
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are vector items ??!!
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Maha Aburahma:
what are vector items ??!!


is the signature of a JComboBox constructor. Vector is the name of a class. items is the name of an argument to the constructor which is a reference to a Vector object.
See the API docs for more details
 
Maha Hassan
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ..got it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!