void rebuildButtons() { stringToObjects = new Hashtable(); stringToButtons = new Hashtable(); buttonsPanel.removeAll(); // buttonGroup = new ButtonGroup(); int newSize = getSize(); // for (int i = 0; i < getSize(); i ++) { for (int i = 0; i < newSize; i++) { Object item = getElementAt(i); String itemString = item.toString(); // AbstractButton button = new JRadioButton(itemString); VirtualButton button = createButton(itemString); setColors(button); // VirtualButton button = createButton (itemString); button.setActionCommand(itemString); stringToObjects.put(itemString, item); stringToButtons.put(itemString, button); button.addActionListener(this); // buttonGroup.add(radioButton); buttonsPanel.add(button); doAdditionalProcessing(button); } // force the first item to be selected lastSelectedItem = null; // int numCols = getObjectAdapter().getUnboundButtonsRowSize(); setLayout(); // not sure we need this as color is set before this // setColors(buttonsPanel); /* buttonsPanel.setLayout(new GridLayout (0, numCols)); oldSize = getSize(); */ oldSize = newSize; }