private void initializeLauncherMenuBar(JFrame launcherMainFrame, JFrame launcherLogWindow)
    {
        this.launcherMainFrame = launcherMainFrame;
        this.launcherLogWindow = launcherLogWindow;

        //int acceleratorMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();

        // File menu
        
        if (!System.getProperty("os.name").startsWith("Mac"))
        {
            fileMenu.add(exitMenuItem);
            add(fileMenu);
        }

        // Edit menu
        
        // The edit menu was only implemented for Mac OS X in the wxPython 
        // Launcher, because on Mac OS X, in wxPython you don't get the 
        // right-click menu in a text area (e.g. log window), so you need 
        // an Edit menu to be able to copy or select all.
        if (System.getProperty("os.name").startsWith("Mac"))
        {
            editMenu.add(cutMenuItem);
            editMenu.add(copyMenuItem);
            editMenu.add(pasteMenuItem);
            editMenu.add(selectAllMenuItem);
            editMenu.add(selectNoneMenuItem);
            add(editMenu);
        }

        launcherMainFrameMenuItem.setText(launcherMainFrame.getTitle());
        windowMenu.add(launcherMainFrameMenuItem);
        if (launcherLogWindow!=null)
        {
            logWindowHasBeenAddedToWindowsMenu = true;
            launcherLogWindowMenuItem.setText(launcherLogWindow.getTitle());
            windowMenu.add(launcherLogWindowMenuItem);
        }
        add(windowMenu);

        helpMenu.add(aboutMenuItem);
        add(helpMenu);

        // File menu event handlers

        exitMenuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ae)
            {
                // FIXME: Should do a clean up here.
                System.exit(0);
            }
        });

        // Edit menu event handlers

        cutMenuItem.setAccelerator(KeyStroke.getKeyStroke("meta pressed X"));
        copyMenuItem.setAccelerator(KeyStroke.getKeyStroke("meta pressed C"));
        pasteMenuItem.setAccelerator(KeyStroke.getKeyStroke("meta pressed V"));
        selectAllMenuItem.setAccelerator(KeyStroke.getKeyStroke("meta pressed A"));
        selectNoneMenuItem.setAccelerator(KeyStroke.getKeyStroke("shift meta pressed A"));

        if (System.getProperty("os.name").startsWith("Mac"))
        {
            cutMenuItem.addActionListener(new DefaultEditorKit.CutAction());
            copyMenuItem.addActionListener(new DefaultEditorKit.CopyAction());
            pasteMenuItem.addActionListener(new DefaultEditorKit.PasteAction());

            class SelectAllAction extends TextAction
            {
                public SelectAllAction()
                {
                    super("Select All");
                }

                public void actionPerformed(ActionEvent e)
                {
                    JTextComponent component = getFocusedComponent();
                    component.selectAll();
                }
            }
            selectAllMenuItem.addActionListener(new SelectAllAction());

            class SelectNoneAction extends TextAction
            {
                public SelectNoneAction()
                {
                    super("Select None");
                }

                public void actionPerformed(ActionEvent e)
                {
                    JTextComponent component = getFocusedComponent();
                    component.setCaretPosition(0);
                }
            }
            selectNoneMenuItem.addActionListener(new SelectNoneAction());
        }
       
        // Window menu event handlers
        
        launcherMainFrameMenuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ae)
            {
                launcherMenuBar.launcherMainFrame.setVisible(true);
                launcherMenuBar.launcherMainFrame.setExtendedState(JFrame.NORMAL);
                launcherMenuBar.launcherMainFrame.toFront();
                launcherMenuBar.launcherMainFrame.requestFocus();
                //launcherMainFrameMenuItem.setState(true);
                //launcherLogWindowMenuItem.setState(false);
            }
        });

        if (launcherLogWindow!=null)
        {
            launcherLogWindowMenuItem.addActionListener(new ActionListener()
            {
                public void actionPerformed(ActionEvent ae)
                {
                    launcherMenuBar.launcherLogWindow.setVisible(true);
                    launcherMenuBar.launcherLogWindow.setExtendedState(JFrame.NORMAL);
                    launcherMenuBar.launcherLogWindow.toFront();
                    launcherMenuBar.launcherLogWindow.requestFocus();
                    //launcherMainFrameMenuItem.setState(false);
                    //launcherLogWindowMenuItem.setState(true);
                }
            });
        }

        // Help menu event handlers

        aboutMenuItem.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ae)
            {
                Class launcherMainFrameClass = launcherMenuBar.launcherMainFrame.getClass();
                Icon massiveIcon = new ImageIcon(launcherMainFrameClass.getResource("MASSIVElogoTransparent64x64.png"));
                JOptionPane.showMessageDialog(launcherMenuBar.launcherMainFrame,
                  "MASSIVE/CVL Launcher (Java) v" + LauncherVersionNumber.javaLauncherVersionNumber,
                  "About MASSIVE/CVL Launcher", JOptionPane.INFORMATION_MESSAGE, massiveIcon);
            }
        });
    }