env.getBrowserManager().addBrowser(bif);
    public void loadDataset(int datasetID)    {        DataManagementService dms = registry.getDataManagementService();        DatasetData dataset;                final BrowserModel model = new BrowserModel();        model.setLayoutMethod(new NumColsLayoutMethod(8));        BrowserTopModel topModel = new BrowserTopModel();                BPalette modePalette = PaletteFactory.getMainPalette(model,topModel);        topModel.addPalette("Modes",modePalette);        BPalette paintPalette = PaletteFactory.getPaintModePalette(model,topModel);        topModel.addPalette("Overlays",paintPalette);        BPalette zoomPalette = PaletteFactory.getZoomPalette(model,topModel);        topModel.addPalette(UIConstants.ZOOM_PALETTE_NAME,zoomPalette);                modePalette.setOffset(0,0);        paintPalette.setOffset(0,75);        zoomPalette.setOffset(0,125);        BrowserView view = new BrowserView(model,topModel);        BrowserController controller = new BrowserController(model,topModel,view);        controller.setStatusView(new StatusBar());        int count = env.getBrowserManager().getBrowserCount();        env.getBrowserManager().addBrowser(controller);        final int browserIndex = count;        final BrowserInternalFrame bif = new BrowserInternalFrame(controller);        StatusBar status = controller.getStatusView();        tf.addToDesktop(bif,TopFrame.PALETTE_LAYER);        bif.setClosable(true);        bif.setIconifiable(true);        bif.setMaximizable(true);        bif.setResizable(true);        bif.show();                final int theDataset = datasetID;        Thread retrieveThread = new Thread()        {            public void run()            {                try                {                    DataManagementService dms =                        registry.getDataManagementService();                    DatasetData dataset = dms.retrieveDataset(theDataset);                    model.setDataset(dataset);                    bif.setTitle("Image Browser: "+dataset.getName());                    loadDataset(browserIndex,dataset);                }                catch(DSAccessException dsae)                {                    UserNotifier notifier = registry.getUserNotifier();                    notifier.notifyError("Data retrieval failure",                    "Unable to retrieve dataset (id = " + theDataset + ")", dsae);                    return;                }                catch(DSOutOfServiceException dsoe)                {                    // pop up new login window (eventually caught)                    throw new RuntimeException(dsoe);                }            }        };                retrieveThread.start();        writeStatusImmediately(status,"Loading dataset from DB...");                }