model.setDefaultLayoutMethod(new NumColsLayoutMethod(8));
    public void loadDataset(int datasetID)    {        BrowserManager manager = env.getBrowserManager();        int index;        if((index = manager.hasBrowser(datasetID))            != BrowserManager.NOT_FOUND)        {            manager.setActiveBrowser(index);            return;        }        DataManagementService dms = registry.getDataManagementService();        DatasetData dataset;                final BrowserModel model = new BrowserModel();        model.setLayoutMethod(new NumColsLayoutMethod(8));        BrowserTopModel topModel = new BrowserTopModel();                BPalette optionPalette = PaletteFactory.getOptionPalette(model,topModel);        topModel.addPalette(UIConstants.OPTIONS_PALETTE_NAME,optionPalette);        topModel.hidePalette(optionPalette);                optionPalette.setOffset(0,0);        BrowserView view = new BrowserView(model,topModel);        BrowserController controller = new BrowserController(model,topModel,view);        controller.setStatusView(new StatusBar());        final int browserIndex = 0; // default behavior for new browser        final BrowserInternalFrame bif = new BrowserInternalFrame(controller);        env.getBrowserManager().addBrowser(bif);        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;        KillableThread retrieveThread = new KillableThread()        {            public void run()            {                addLoaderThread(bif.getController(),this);                try                {                    DataManagementService dms =                        registry.getDataManagementService();                    DatasetData dataset = dms.retrieveDataset(theDataset);                    model.setDataset(dataset);                    if(!kill)                    {                        bif.setTitle("Image Browser: "+dataset.getName());                        loadDataset(browserIndex,dataset);                    }                    else                    {                        System.err.println("killed OK");                    }                }                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);                }                removeLoaderThread(bif.getController(),this);            }        };                retrieveThread.start();        writeStatusImmediately(status,"Loading dataset from DB...");                }