public Menu(Window window)
    {
        this.window = window;

        // Add the F1 -> help mapping
        window.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(helpKeyStroke, "KEYCLICK");
        window.getRootPane().getActionMap().put("KEYCLICK", keyclickAction);

        final JMenu[] menus = new JMenu[MAIN_MENU_ITEMS.length];

        for (int i = 0; i < MAIN_MENU_ITEMS.length; i++)
        {
            menus[i] = new JMenu(MAIN_MENU_ITEMS[i]);
            menus[i].setMnemonic(MAIN_MNOMONICS[i]);
            
            for (int j = 0; j < MENU_OPTIONS[i].length; j++)
            {
                final JMenuItem jmi = new JMenuItem(MENU_OPTIONS[i][j].label);
                jmi.addActionListener(mal);
                jmi.setMnemonic(MENU_OPTIONS[i][j].mnemonic);
                
                if (MENU_OPTIONS[i][j].accelerator != null) 
                    jmi.setAccelerator(MENU_OPTIONS[i][j].accelerator);
                
                menus[i].add(jmi); // add the submenu
            }
            
            add(menus[i]); // add the menu
        }
    }