• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Retaining JCombo values

 
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to retain the combo box values.

My requirement is something like this.

As soon as the application starts, user cliks an icon, a combo box appears, user selects a value from the drop down, whenever the user clicks the icon and combo box appears, the same value should be retained.

Thanks

Cosmos
 
Pol Appan
Ranch Hand
Posts: 144
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pls some one help me with this.

Any help is highly appreciable.

Thanks

Cosmos
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I may not be understanding your question, you want to select an item in the comboBox and that item be displayed in index 0 of the box, or do you want the original value to be displayed?

To keep the original, because if I remember, the comboBox switches the selected item to index 0 of the comboBox, you could keep a vector of objects to populate the box, then after you select, you can repopulate. You may have to separately save the selected item to an instance variable.

There may be a built in method to not retain selectedItem in view, I have not researched it.

[ October 20, 2004: Message edited by: Samuel Mendenhall ]

[ October 20, 2004: Message edited by: Samuel Mendenhall ]
[ October 20, 2004: Message edited by: Samuel Mendenhall ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic