JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.WRAP_TAB_LAYOUT); tabs.setAlignmentX(LEFT_ALIGNMENT);
    private JPanel buildTabbedPanel(ROIAgtCtrl control, IconManager im,                                     int sizeT, int sizeZ)    {        JTabbedPane tabs = new JTabbedPane(JTabbedPane.TOP,                                     JTabbedPane.WRAP_TAB_LAYOUT);        tabs.setAlignmentX(LEFT_ALIGNMENT);        ResultsPerROIPane roiPane;        StatsResultsPane pane;        int c = 0;        Icon up = im.getIcon(IconManager.UP),             down = im.getIcon(IconManager.DOWN);        List analysedROI = control.getAnalyzedROI();        Iterator i = analysedROI.iterator();        ScreenROI roi;        ROIStats roiStats;        Map results = control.getROIResults();        String[] channels = control.getAnalyzedChannels();        int channel = control.getAnalyzedChannel(0);        listROIs = new String[analysedROI.size()];        while (i.hasNext()) {            roi = (ScreenROI) i.next();            roiStats = (ROIStats) results.get(roi.getActualROI());            roiPane = new ResultsPerROIPane(c, manager, channels,                                 roi.getName(), roi.getAnnotation());            pane =  new StatsResultsPane(manager, roiStats, sizeT, sizeZ,                                         channel, channels.length, up, down);            roiPane.addToContainer(pane);            paneMap.put(new Integer(c), pane);            tabs.insertTab("ROI #"+roi.getIndex(), null, roiPane, null, c);            listROIs[c] = "ROI #"+roi.getIndex();            c++;        }        JPanel p = new JPanel();        p.setLayout(new BorderLayout(0, 0));        p.add(tabs, BorderLayout.CENTER);        return p;    }