private void createWindow()
    {
        frame = new JFrame("Wumpus World");
        frame.setSize(840, 640);
        frame.getContentPane().setLayout(new FlowLayout());
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        
        gamepanel = new JPanel();
        gamepanel.setPreferredSize(new Dimension(600,600));
        gamepanel.setBackground(Color.GRAY);
        gamepanel.setLayout(new GridLayout(4,4));
        
        //Add blocks
        blocks = new JPanel[4][4];
        for (int j = 3; j >= 0; j--)
        {
            for (int i = 0; i < 4; i++)
            {
                blocks[i][j] = new JPanel();
                blocks[i][j].setBackground(Color.white);
                blocks[i][j].setPreferredSize(new Dimension(150,150));
                blocks[i][j].setBorder(BorderFactory.createLineBorder(Color.black));
                blocks[i][j].setLayout(new GridLayout(2,2));
                gamepanel.add(blocks[i][j]);
            }
        }
        frame.getContentPane().add(gamepanel);
        
        //Add buttons panel
        JPanel buttons = new JPanel();
        buttons.setPreferredSize(new Dimension(200,600));
        buttons.setLayout(new FlowLayout());
        //Status label
        status = new JLabel("", SwingConstants.CENTER);
        status.setPreferredSize(new Dimension(200,25));
        buttons.add(status);
        //Score label
        score = new JLabel("Score: 0", SwingConstants.CENTER);
        score.setPreferredSize(new Dimension(200,25));
        buttons.add(score);
        //Buttons
        JButton bl = new JButton(new ImageIcon("gfx/TL.png"));
        bl.setActionCommand("TL");
        bl.addActionListener(this);
        buttons.add(bl);
        JButton bf = new JButton(new ImageIcon("gfx/MF.png"));
        bf.setActionCommand("MF");
        bf.addActionListener(this);
        buttons.add(bf);
        JButton br = new JButton(new ImageIcon("gfx/TR.png"));
        br.setActionCommand("TR");
        br.addActionListener(this);
        buttons.add(br);
        JButton bg = new JButton("Grab");
        bg.setPreferredSize(new Dimension(45,22));
        bg.setActionCommand("GRAB");
        bg.addActionListener(this);
        buttons.add(bg);
        JButton bc = new JButton("Climb");
        bc.setPreferredSize(new Dimension(55,22));
        bc.setActionCommand("CLIMB");
        bc.addActionListener(this);
        buttons.add(bc);
        JButton bs = new JButton("Shoot");
        bs.setPreferredSize(new Dimension(65,22));
        bs.setActionCommand("SHOOT");
        bs.addActionListener(this);
        buttons.add(bs);
        JButton ba = new JButton("Run Solving Agent");
        ba.setActionCommand("AGENT");
        ba.addActionListener(this);
        buttons.add(ba);
        //Add a delimiter
        JLabel l = new JLabel("");
        l.setPreferredSize(new Dimension(200,25));
        buttons.add(l);
        //Fill dropdown list
        Vector<String> items = new Vector<String>();
        for (int i = 0; i < maps.size(); i++)
        {
            items.add((i+1) + "");
        }
        items.add("Random");
        mapList = new JComboBox(items);
        mapList.setPreferredSize(new Dimension(180,25));
        buttons.add(mapList);
        JButton bn = new JButton("New Game");
        bn.setActionCommand("NEW");
        bn.addActionListener(this);
        buttons.add(bn);
        
        frame.getContentPane().add(buttons);
        
        updateGame();
        
        //Show window
        frame.setVisible(true);
    }