channelButton = new ChannelToggleButton(""+d.getEmissionWavelength() , model.getChannelColor(j), j); channelList.add(channelButton); if (model.getSelectedChannel() == j) channelButton.setSelected(true);
item = new ChannelToggleButton(""+d.getEmissionWavelength(), model.getChannelColor(j), j); channelList.add(item); item.setSelected(model.getSelectedChannel() == j);
    private JPanel createChannelButtons()    {        JPanel p = new JPanel();        p.setLayout(new BoxLayout(p, BoxLayout.Y_AXIS));        ChannelMetadata[] data = model.getChannelData();        boolean gs = model.getColorModel().equals(ImViewer.GREY_SCALE_MODEL);        ChannelMetadata d;        ChannelToggleButton channelButton;        p.add(Box.createRigidArea(VBOX));        for (int j = 0; j < data.length; j++) {        	d = data[j];                	channelButton = new ChannelToggleButton(""+d.getEmissionWavelength()        						, model.getChannelColor(j), j);        	channelList.add(channelButton);        	if (model.getSelectedChannel() == j)            	channelButton.setSelected(true);           	channelButton.setGrayedOut(gs);            channelButton.addPropertyChangeListener(controller);            channelButton.setPreferredSize(new Dimension(30, 30));            channelButton.setMinimumSize(new Dimension(30, 30));            p.add(channelButton);            p.add(Box.createRigidArea(VBOX));        }        return UIUtilities.buildComponentPanel(p);         }