private void createJMenuBar() {
        JMenuBar menuBar = new JMenuBar();
        
        JMenu sudokuMenu = new JMenu("Sudoku");
        sudokuMenu.setMnemonic(KeyEvent.VK_S);
        JMenu newMenu = new JMenu("New");
        newMenu.setMnemonic(KeyEvent.VK_N);
        JMenu settingsMenu = new JMenu("Settings");
        settingsMenu.setMnemonic(KeyEvent.VK_T);
        JMenu autoSolvingMenu = new JMenu("Solver");
        JMenu suggestionsMenu = new JMenu("Suggestions");
        suggestionsMenu.setMnemonic(KeyEvent.VK_S);
        JMenu autoPossMenu = new JMenu("Auto remove");
        JMenu scoresMenu = new JMenu("Scores");
        scoresMenu.setMnemonic(KeyEvent.VK_C);
        JMenu helpMenu = new JMenu("Help");
        helpMenu.setMnemonic(KeyEvent.VK_H);

        easyGameMenuItem.setMnemonic(KeyEvent.VK_E);
        easyGameMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionNewSudoku(Grid.DIFFICULTY_EASY);
            }
        });
        
        mediumGameMenuItem.setMnemonic(KeyEvent.VK_M);
        mediumGameMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionNewSudoku(Grid.DIFFICULTY_MEDIUM);
            }
        });
        
        hardGameMenuItem.setMnemonic(KeyEvent.VK_H);
        hardGameMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionNewSudoku(Grid.DIFFICULTY_HARD);
            }
        });
        
        customMenuItem.setMnemonic(KeyEvent.VK_C);
        customMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionNewSudoku(Grid.DIFFICULTY_NONE);
            }
        });

        solveMenuItem.setMnemonic(KeyEvent.VK_S);
        solveMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionSolve();
            }
        });
        
        validateMenuItem.setMnemonic(KeyEvent.VK_V);
        validateMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (MainFrame.this.cheatingConfirmed()) {
                    actionValidate();
                }
            }
        });
        
        hintMenuItem.setMnemonic(KeyEvent.VK_H);
        hintMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (MainFrame.this.cheatingConfirmed()) {
                    if (!sudoku.hint()) {
                        JOptionPane.showMessageDialog(MainFrame.this,
                                "<html><font size=5 color=red>"
                                + "Hint unavailable"
                                + "</font></html>",
                                MainFrame.this.getTitle(),
                                JOptionPane.PLAIN_MESSAGE);
                    }
                }
            }
        });
        
        resetMenuItem.setMnemonic(KeyEvent.VK_R);
        resetMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (MainFrame.this.cheatingConfirmed()) {
                    sudoku.reset();
                    resetLabels();
                    stopwatchLabel.start();
                }
            }
        });
        
        exitMenuItem.setMnemonic(KeyEvent.VK_E);
        exitMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionExit();
            }
        });
        
        autoFillSlider.setPaintLabels(true);
        autoFillSlider.setLabelTable(new Hashtable() {
            {
                put(0, new JLabel("Off"));
                put(1, new JLabel("Basic"));
                put(2, new JLabel("Advanced"));
            }
        });
        autoFillSlider.setFocusable(false);
        autoFillSlider.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseReleased(MouseEvent e) {
                if (autoFillSlider.getValue() > 0
                        && MainFrame.this.cheatingConfirmed()) {
                    sudoku.setAutoFillBasic(autoFillSlider.getValue() >= 1);
                    sudoku.setAutoFillAdvanced(autoFillSlider.getValue() >= 2);
                } else {
                    autoFillSlider.setValue(0);
                    sudoku.setAutoFillBasic(false);
                    sudoku.setAutoFillAdvanced(false);
                }
            }
        });
        
        fillPossMenuItem.setMnemonic(KeyEvent.VK_F);
        fillPossMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (MainFrame.this.cheatingConfirmed()) {
                    sudoku.fillSuggestions();
                    sudoku.refresh();
                    resetLabels();
                }
            }
        });
        
        autoPossSlider.setPaintLabels(true);
        autoPossSlider.setLabelTable(new Hashtable() {
            {
                put(0, new JLabel("Off"));
                put(1, new JLabel("Basic"));
                put(2, new JLabel("Advanced"));
            }
        });
        autoPossSlider.setFocusable(false);
        autoPossSlider.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseReleased(MouseEvent e) {
                if (autoPossSlider.getValue() > 0
                        && MainFrame.this.cheatingConfirmed()) {
                    sudoku.setAutoPossBasic(autoPossSlider.getValue() >= 1);
                    sudoku.setAutoPossAdvanced(autoPossSlider.getValue() >= 2);
                } else {
                    autoPossSlider.setValue(0);
                    sudoku.setAutoPossBasic(false);
                    sudoku.setAutoPossAdvanced(false);
                }
            }
        });
        
        possAsNumStyle.setMnemonic(KeyEvent.VK_N);
        possAsNumStyle.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                sudoku.setPossAsNum(possAsNumStyle.isSelected());
                sudoku.refresh();
            }
        });
        
        easyScoresMenuItem.setMnemonic(KeyEvent.VK_E);
        easyScoresMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionShowScores(Grid.DIFFICULTY_EASY);
            }
        });
        
        mediumScoresMenuItem.setMnemonic(KeyEvent.VK_M);
        mediumScoresMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionShowScores(Grid.DIFFICULTY_MEDIUM);
            }
        });
        
        hardScoresMenuItem.setMnemonic(KeyEvent.VK_H);
        hardScoresMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionShowScores(Grid.DIFFICULTY_HARD);
            }
        });
        
        extremeScoresMenuItem.setMnemonic(KeyEvent.VK_X);
        extremeScoresMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionShowScores(Grid.DIFFICULTY_EXTREME);
            }
        });
        
        aboutMenuItem.setMnemonic(KeyEvent.VK_A);
        aboutMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionAbout();
            }
        });
        
        keysMenuItem.setMnemonic(KeyEvent.VK_K);
        keysMenuItem.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                actionKeys();
            }
        });

        possLabel.setFont(new Font("Arial", Font.PLAIN, 12));

        typeLabel.setHorizontalAlignment(JLabel.CENTER);
        typeLabel.setPreferredSize(new Dimension(20, 0));
        typeLabel.setFont(new Font("Arial", Font.BOLD, 12));

        stopwatchLabel.setFont(new Font("Courier New", Font.BOLD, 12));

        setJMenuBar(menuBar);
            menuBar.add(sudokuMenu);
                sudokuMenu.add(newMenu);
                    newMenu.add(easyGameMenuItem);
                    newMenu.add(mediumGameMenuItem);
                    newMenu.add(hardGameMenuItem);
                    newMenu.add(new JSeparator());
                    newMenu.add(customMenuItem);
                sudokuMenu.add(solveMenuItem);
                sudokuMenu.add(validateMenuItem);
                sudokuMenu.add(hintMenuItem);
                sudokuMenu.add(resetMenuItem);
                sudokuMenu.add(exitMenuItem);
            menuBar.add(settingsMenu);
                settingsMenu.add(autoSolvingMenu);
                    autoSolvingMenu.add(autoFillSlider);
                settingsMenu.add(suggestionsMenu);
                    suggestionsMenu.add(autoPossMenu);
                        autoPossMenu.add(autoPossSlider);
                    suggestionsMenu.add(possAsNumStyle);
                    suggestionsMenu.add(fillPossMenuItem);
            menuBar.add(scoresMenu);
                scoresMenu.add(easyScoresMenuItem);
                scoresMenu.add(mediumScoresMenuItem);
                scoresMenu.add(hardScoresMenuItem);
//                scoresMenu.add(extremeScoresMenuItem); //TODO extreme difficulty
            menuBar.add(helpMenu);
                helpMenu.add(aboutMenuItem);
                helpMenu.add(keysMenuItem);
            menuBar.add(Box.createHorizontalGlue());
            menuBar.add(possLabel);
            menuBar.add(Box.createHorizontalStrut(10));
            menuBar.add(typeLabel);
            menuBar.add(Box.createHorizontalStrut(10));
            menuBar.add(stopwatchLabel);
            menuBar.add(Box.createHorizontalStrut(5));
    }