public void init()
    {
        // Set up dictionary and board
        dictionary = new Dictionary();
        board = new RuzzleBoard();
        solved = false;

        // Set up GUI elements
        pnlBoard = new JPanel();
        pnlBoard.setLayout(new GridLayout(0,RuzzleBoard.NUM_COLS));
        boardPanels = new JPanel[RuzzleBoard.NUM_ROWS][RuzzleBoard.NUM_COLS];
        guiBoard = new JTextField[RuzzleBoard.NUM_ROWS][RuzzleBoard.NUM_COLS];
        for(int r = 0; r < RuzzleBoard.NUM_ROWS; r++)
        {
            for(int c = 0; c < RuzzleBoard.NUM_COLS; c++)
            {
                boardPanels[r][c] = new JPanel();
                boardPanels[r][c].setLayout(new GridLayout(0,3));
                guiBoard[r][c] = new JTextField();
                guiBoard[r][c].getDocument().addDocumentListener(new GuiBoardListener(r,c));
                for(int x = 0; x < 4; x++) boardPanels[r][c].add(new JLabel(""));
                boardPanels[r][c].add(guiBoard[r][c]);
                for(int x = 0; x < 4; x++) boardPanels[r][c].add(new JLabel(""));
                boardPanels[r][c].setBorder(new LineBorder(Color.BLACK,1,true));
                boardPanels[r][c].setBackground(Color.gray);
                pnlBoard.add(boardPanels[r][c]);
            }
        }
        guiBoard[RuzzleBoard.NUM_ROWS-1][RuzzleBoard.NUM_COLS-1].addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                btnSolve.requestFocus();
                solve();
            }
        });

        pnlButton = new JPanel();
        pnlButton.setLayout(new GridLayout(0,4));
        btnSolve = new JButton("Solve");
        btnSolve.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                solve();
            }
        });
        btnClear = new JButton("Clear");
        btnClear.addActionListener(new ActionListener(){
            public void actionPerformed(ActionEvent e)
            {
                clear();
            }
        });
        for(int x = 0; x < 5; x++) pnlButton.add(new JLabel(""));
        pnlButton.add(btnSolve);
        pnlButton.add(btnClear);
        for(int x = 0; x < 5; x++) pnlButton.add(new JLabel(""));
       
        lstSolution = new JList();
        lstSolution.addListSelectionListener(new ListSelectionListener(){
            public void valueChanged(ListSelectionEvent e)
            {
                selectionChanged();
            }
        });
        pnlScroll = new JScrollPane(lstSolution);

        pnlBoardAndSolution = new JPanel();
        pnlBoardAndSolution.setLayout(new GridLayout(0,2));
        pnlBoardAndSolution.add(pnlBoard);
        pnlBoardAndSolution.add(pnlScroll);

        this.setLayout(new GridLayout(0,1));
        this.setSize(500, 500);
        this.add(pnlBoardAndSolution);
        this.add(pnlButton);
    }