combobox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    #1

    combobox

    Code:
    kontenery.remove(konteneryList2.getSelectedItem());
         	
         	konteneryList1.removeAll();
       	 konteneryList2.removeAll();
       	 Set kontener_keys=kontenery.keySet();
       	 Object[] keys_tab=kontener_keys.toArray();
       	 
       	for(int i=0;i<keys_tab.length;i++)
       		konteneryList1.addItem(keys_tab[i]);
       
       	 for(int j=0; j<keys_tab.length;j++)
       		konteneryList2.addItem(keys_tab[j]);
    i want to set the combobox with keys from a map but the combobox doesnt reset when i remove an element from a map
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by oll3i
    i want to set the combobox with keys from a map but the combobox doesnt reset when i remove an element from a map
    How should that combobox 'know' that you've altered a map somewhere?
    Comboboxes are way too stupid for that. Better build a little class or method
    that alters the map for you and does the same to the combobox. Those objects
    aren't psychic you know ;-)

    kind regards,

    Jos

    Comment

    Working...