private void startup() {
        HSSettings settings = HSSettings.getInstance();

        // The channel store loads its current set of channels. If no channel
        // list is found then a default set of channels will be loaded into the
        // list.
        channelStore.setItemHistory(itemHistory);
        channelStore.load(settings.getChannelStoreFile());
        itemStore.load(settings.getItemStoreFile());
        itemHistory.load(settings.getItemHistoryFile());

        // Set up the listeners.
        itemStore.addItemStoreListener(itemStoreListener);
        channelStore.addChannelStoreListener(channelStoreListener);

        try {
            bsfManager.declareBean("channelStore", channelStore, ChannelStore.class);
            bsfManager.declareBean("itemStore", itemStore, ItemStore.class);
        } catch (BSFException bsfe) {
            cat.error("Unable to declare beans for scripting due to " + bsfe);
        }
        
        // Normally Java Web Start handles a proxy for us, even if it is a proxy
        // that requires authentication. However, if HotSheet is run from the
        // command line the proxy has to be set manually so we have properties
        // to set us up for proxy operation (though it is not good enough for
        // an authenticated proxy.
        //
        // Note that the default value of this is false so unless the user sets
        // something it will not be used.
	boolean useProxy = new Boolean(
            settings.getProperties().getProperty("http.proxySet", 
            "false")).booleanValue();

	if (useProxy) {
            System.setProperty("http.proxySet", "true");
            System.setProperty("http.proxyHost", 
                settings.getProperties().getProperty("http.proxyHost"));
            System.setProperty("http.proxyPort", 
                settings.getProperties().getProperty("http.proxyPort"));

            // See if we have an authentication name for authenticating proxies.
            boolean useAuth = new Boolean(
                settings.getProperties().getProperty("http.authSet", 
                "false")).booleanValue();

            if (useAuth) {
                final String authenticationName = 
                    settings.getProperties().getProperty("http.authName");
                final String authenticationPassword = 
                    settings.getProperties().getProperty("http.authPass");

                try {
                    //registering with the system.
                    Authenticator.setDefault(new Authenticator() {
                        protected PasswordAuthentication getPasswordAuthentication() {
                            return new PasswordAuthentication(
                                authenticationName, 
                                authenticationPassword.toCharArray());
                        }
                    });
                } catch (SecurityException se) {
                    cat.error("Security exception while registering Authenticator with system: ", 
                        se);
                }
            }
        }
        
        // If the user wants to have refresh occur automatically then the number
        // of seconds to wait between refreshes will be set in the properties
        // file.
        int refreshInterval = (new Integer(
            settings.getProperties().getProperty("refresh.interval", 
            "0"))).intValue();

        if (refreshInterval > 0) {
            timer.scheduleAtFixedRate(new TimerTask() {
                public void run() {
                    channelStore.retrieve(true);
                }
            }, refreshInterval * 1000, refreshInterval * 1000);
        }
        
        // If the item store is empty query the user about going ahead and doing
        // a refresh now.
        if (itemStore.size() == 0) {
            int answer = JOptionPane.showConfirmDialog(this, 
                "Would you like to refresh all channels? (New HotSheet users should always say yes)",
                "Refresh Now?", JOptionPane.YES_NO_OPTION);

            if (answer == JOptionPane.YES_OPTION) {
                refreshAllChannels();
            }
        } else {
            updateItemList();
        }
    }