private void buildTabs(){
        // Get the active games
        byte[] activeGameIds = GameFactory.getActiveGameIds();
        
        // Only run when the active games has changed
        if(Arrays.equals(activeGameIds, activeGames))
            return;

        // Store the active games
        activeGames = activeGameIds;
        
        // Build/Re-build the empty panels as needed
        if(emptyPanels == null || emptyPanels.length < activeGames.length){
            emptyPanels = new javax.swing.JPanel[activeGames.length];
            
            for(int x=0; x<activeGames.length; x++){
                emptyPanels[x] = new javax.swing.JPanel();
            }
        }
        
        // Initialize the tabs
        tabPane.removeAll();
        Game g;
        
        for(int x=0; x<activeGames.length; x++){
            g = GameFactory.getGameFromID(activeGames[x]);
            
            if(g != null)
                tabPane.addTab(g.getName(),
                        g.getIcon(),
                        emptyPanels[x],
                        "Manage " + g.getFullName() + " Profiles");
        }

        // Set the selected tab as best as possible
        if(previousTab >= tabPane.getTabCount())
            previousTab = tabPane.getTabCount() - 1;
        
        // If there is only one tab the tab change state event doesn't always fire
        // Ensure that in this situation it fires.
        if(tabPane.getTabCount() == 1)
            tabPaneStateChanged( new javax.swing.event.ChangeEvent(new Object()) );
        else
            tabPane.setSelectedIndex(previousTab);
    }