private void createCommands() {
        commandMap = new HashMap<>();
        commandMap.put("StartGame", new Command() {
            @Override
            public void executeCommand() {
                optionDialog.reset();
                runApplication();
            }
        });

        commandMap.put("PlayAgain", new Command() {
            @Override
            public void executeCommand() {
                winDialog.hidDialog();
                runApplication();
            }
        });

        commandMap.put("Options", new Command() {
            @Override
            public void executeCommand() {
                optionDialog.execute();
            }
        });

        commandMap.put("NewGame", new Command() {
            @Override
            public void executeCommand() {
                if (gameOverDialog != null) gameOverDialog.hidDialog();
                runApplication();
            }
        });

        commandMap.put("Help", new Command() {
            @Override
            public void executeCommand() {
                Dialog helpD = createHelpDialog();
                helpD.showDialog();
            }
        });

        commandMap.put("Restart", new Command() {
            @Override
            public void executeCommand() {
                gameOverDialog.hidDialog();
                mineFieldViewer.restart();
                imageViewerControl.reset();
                imageViewerControl.viewImage("waitIcon.jpg");
                applicationFrame.getInfoPanel().resetClock();
                firstTime = true;
            }
        });

        commandMap.put("Winner", new Command() {
            @Override
            public void executeCommand() {
                if (winDialog == null) winDialog = createWinnerDialog();
                winDialog.showDialog();
                imageViewerControl.viewImage("winnerIcon.jpg");
                applicationFrame.getInfoPanel().stopClock();
            }
        });

        commandMap.put("GameOver", new Command() {
            @Override
            public void executeCommand() {
                if (gameOverDialog == null) gameOverDialog = createOverDialog();
                gameOverDialog.showDialog();
                applicationFrame.getInfoPanel().stopClock();
                imageViewerControl.viewImage("loserIcon.jpg");
            }
        });

        commandMap.put("SquareViewerSelected", new Command() {

            @Override
            public void executeCommand() {
                imageViewerControl.viewImage("moveIcon.jpg");
            }
        });

        commandMap.put("SquareViewerUnselected", new Command() {

            @Override
            public void executeCommand() {
                imageViewerControl.viewImage("waitIcon.jpg");
            }
        });
        
        commandMap.put("showField", new ShowCommand() {
            @Override
            public void execute(int x, int y) {
                mineFieldViewer.showField(x, y);
                if (firstTime) {
                    applicationFrame.getInfoPanel().startClock();
                    firstTime = false;
                }
            }

            @Override
            public void executeCommand() {
            }
        });
        
        commandMap.put("Exit", new Command() {
            @Override
            public void executeCommand() {
                System.exit(0);
            }
        });
    }