private void init() {
        frame = new JFrame();
        frame.setLayout(new GridLayout(26, 26));
        frame.addKeyListener(this);    // JLabel cannot get keyboard focus
        frame.setResizable(true);
        frame.setSize(520, 520);
        frame.setBackground(WATER);
        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        frame.setTitle("Jeroo");
        frame.requestFocusInWindow();

        // save data to the char maps
        char[][] tempMap = Map.getInstance().getCharMatrix();
        for (int i = 0; i < Map.HEIGHT; i++) {
            for (int j = 0; j < Map.WIDTH; j++) {
                map[i][j] = tempMap[i][j];
            }
        }

        // save data to the panel map
        for (int i = 0; i < Map.HEIGHT + 2; i++) {
            for (int j = 0; j < Map.WIDTH + 2; j++) {
                JPanel panel = new JPanel();
                panel.setSize(20, 20);
                panel.setVisible(true);
                if (i < 1 || i > 24 || j < 1 || j > 24) {
                    panel.setBackground(WATER);
                } else {
                    panel.setBackground(GRASS);
                    mapPanels[i - 1][j - 1] = panel;
                }
                frame.add(panel);
            }
        }

        frame.setVisible(true);
        updateMap();
    }