public LifeFrame()
    {
        int[] x_start = {0, 1, 2, 2, 2};
        int[] y_start = {1, 2, 0, 1, 2};
        universePanel = new UniversePanel(this, new Universe(10, 25, x_start, y_start), 20, Color.black, Color.white, false);

        BoxLayout layout = new BoxLayout(mainPanel, BoxLayout.Y_AXIS);
        mainPanel.setLayout(layout);
        mainPanel.add(universePanel);
        mainPanel.add(buttonPanel);

        menuBar = new JMenuBar();

        URL titlebarIconURL = this.getClass().getResource("resources/titlebar_icon.png");
        Image icon = new ImageIcon(titlebarIconURL).getImage();
        this.setIconImage(icon);
        if (SystemTray.isSupported())
            {
                SystemTray tray = SystemTray.getSystemTray();
                TrayIcon trayIcon = new TrayIcon(icon, "Conway Life on a Torus");
                trayIcon.setImageAutoSize(true);
                try
                    {
                        tray.add(trayIcon);
                    }
                catch (AWTException awte)
                    {
                        System.out.println("Failed to load system tray icon");
                    }
            }

        fileMenu = new JMenu("File");
        fileMenu.setMnemonic(KeyEvent.VK_F);
        menuBar.add(fileMenu);

        newBlankUniverse = new JMenuItem("New Blank Universe ...", KeyEvent.VK_N);
        fileMenu.add(newBlankUniverse);
        newBlankUniverse.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
        newBlankUniverse.addActionListener(fileMenuListener);

        newRandomUniverse = new JMenuItem("New Random Universe ...", KeyEvent.VK_R);
        fileMenu.add(newRandomUniverse);
        newRandomUniverse.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.CTRL_MASK));
        newRandomUniverse.addActionListener(fileMenuListener);

        openRLE = new JMenuItem("Open ...", KeyEvent.VK_O);
        openRLE.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
        fileMenu.add(openRLE);
        openRLE.addActionListener(fileMenuListener);

        saveRLE = new JMenuItem("Save ...", KeyEvent.VK_S);
        saveRLE.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
        fileMenu.add(saveRLE);
        saveRLE.addActionListener(fileMenuListener);

        quit = new JMenuItem("Quit", KeyEvent.VK_Q);
        quit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
        fileMenu.add(quit);
        quit.addActionListener(fileMenuListener);

        optionsMenu = new JMenu("Options");
        optionsMenu.setMnemonic(KeyEvent.VK_T);
        menuBar.add(optionsMenu);

        toggleBorders = new JCheckBoxMenuItem("Toggle Cell Borders");
        toggleBorders.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, ActionEvent.CTRL_MASK));
        toggleBorders.setMnemonic(KeyEvent.VK_B);
        optionsMenu.add(toggleBorders);
        toggleBorders.addActionListener(optionsMenuListener);

        togglePopulationCounter = new JCheckBoxMenuItem("Toggle Population Counter");
        togglePopulationCounter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
        togglePopulationCounter.setMnemonic(KeyEvent.VK_P);
        togglePopulationCounter.setState(true);
        optionsMenu.add(togglePopulationCounter);
        togglePopulationCounter.addActionListener(optionsMenuListener);

        toggleGenerationCounter = new JCheckBoxMenuItem("Toggle Generation Counter");
        toggleGenerationCounter.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, ActionEvent.CTRL_MASK));
        toggleGenerationCounter.setMnemonic(KeyEvent.VK_G);
        toggleGenerationCounter.setDisplayedMnemonicIndex(7);
        toggleGenerationCounter.setState(true);
        optionsMenu.add(toggleGenerationCounter);
        toggleGenerationCounter.addActionListener(optionsMenuListener);

        selectSpeed = new JMenuItem("Adjust Speed ...");
        selectSpeed.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK));
        optionsMenu.add(selectSpeed);
        selectSpeed.addActionListener(optionsMenuListener);

        selectColors = new JMenuItem("Select Colors ...", KeyEvent.VK_C);
        selectColors.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
        optionsMenu.add(selectColors);
        selectColors.addActionListener(optionsMenuListener);

        helpMenu = new JMenu("Help");
        helpMenu.setMnemonic(KeyEvent.VK_H);
        menuBar.add(helpMenu);

        documentation = new JMenuItem("Documentation ...", KeyEvent.VK_H);
        documentation.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, ActionEvent.CTRL_MASK));
        helpMenu.add(documentation);
        documentation.addActionListener(helpMenuListener);

        setJMenuBar(menuBar);

        populationLabel.setForeground(Color.BLUE);
        buttonPanel.add(populationLabel);
        buttonPanel.add(step);
        buttonPanel.add(go);
        buttonPanel.add(stop);
        buttonPanel.add(generationLabel);
        go.setBackground(new Color(125, 240, 160));
        stop.setBackground(new Color(250, 150, 150));
        Font serifBold = new Font("Serif", Font.BOLD, 14);
        step.setFont(serifBold);
        go.setFont(serifBold);
        stop.setFont(serifBold);

        step.getInputMap().put(KeyStroke.getKeyStroke("UP"), "step");
        step.getActionMap().put("step", stepAction);
        go.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("RIGHT"), "go");
        go.getActionMap().put("go", goAction);
        stop.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("LEFT"), "stop");
        stop.getActionMap().put("stop", stopAction);

        setContentPane(mainPanel);
    }