private static void showLevel(final SokobanGame sokoban, final String name) {
        SokobanGameRenderer painter = new SokobanGameRenderer();
        BufferedImage bitmap = painter.toImage(sokoban, Orientation.DOWN);
        GameLoop game = new GameLoop(bitmap);
        game.setFocusable(true);

        JFrame frame = new JFrame();
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.add(game);
        frame.setSize(bitmap.getWidth(), bitmap.getHeight() + 32);
        frame.setFocusable(true);
        frame.setVisible(true);
        frame.setTitle(createTitleMessage(sokoban, name));
        @SuppressWarnings("checkstyle:anoninnerlength")
        KeyAdapter keyHandler = new KeyAdapter() {
            @Override
            @SuppressWarnings("IfStatementWithTooManyBranches")
            public void keyPressed(final KeyEvent event) {
                if (event.getKeyCode() == KeyEvent.VK_LEFT) {
                    sokoban.moveLeft();
                    game.setOrientation(Orientation.LEFT);
                }
                else if (event.getKeyCode() == KeyEvent.VK_RIGHT) {
                    sokoban.moveRight();
                    game.setOrientation(Orientation.RIGHT);
                }
                else if (event.getKeyCode() == KeyEvent.VK_UP) {
                    sokoban.moveUp();
                    game.setOrientation(Orientation.UP);
                }
                else if (event.getKeyCode() == KeyEvent.VK_DOWN) {
                    sokoban.moveDown();
                    game.setOrientation(Orientation.DOWN);
                }
                else if (event.getKeyCode() == KeyEvent.VK_R) {
                    sokoban.restart();
                    game.setOrientation(Orientation.DOWN);
                }
                else if (event.getKeyCode() == KeyEvent.VK_U) {
                    sokoban.undo();
                }
                else if (event.getKeyCode() == KeyEvent.VK_ESCAPE) {
                    System.exit(0);
                }
                game.setImage(painter.toImage(sokoban, game.getOrientation()));
                frame.setTitle(createTitleMessage(sokoban, name));
                frame.repaint();
            }
        };
        frame.addKeyListener(keyHandler);
    }