public DetailFrame(ControlFrame controlFrame, GridSquare[][] g) {
        super("Nature Sim");
        this.controlFrame = controlFrame;

        setLocationByPlatform(true);

        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        addWindowListener(this);
        addKeyListener(this);

        widgets = new ArrayList<GridWidget>();

        grid   = new JPanel();
        scroll = new JScrollPane(grid);

        if (g != null) {
            grid.setLayout(new GridLayout(g.length, g[0].length,
                INNER_PADDING, INNER_PADDING));
            for (GridSquare[] row: g) {
                for (GridSquare gs: row) {
                    widgets.add(new GridWidget(gs, this));
                }
            }
        }
        else {
            int i = DEFAULT_SIZE * DEFAULT_SIZE;
            grid.setLayout(new GridLayout(DEFAULT_SIZE, DEFAULT_SIZE,
                INNER_PADDING, INNER_PADDING));
            while (i --> 0) {
                widgets.add(new GridWidget(null, this));
            }
        }

        setBackground(bg);

        scroll.setBorder(BorderFactory.createLineBorder(bg, 0));
        grid.setBorder(BorderFactory.createLineBorder(bg, OUTER_PADDING));
        grid.setBackground(bg);

        for (GridWidget widget: widgets) {
            grid.add(widget);
        }

        scroll.getHorizontalScrollBar().setBlockIncrement(3 * 24);
        scroll.getHorizontalScrollBar().setUnitIncrement (3 * 24);
        scroll.getVerticalScrollBar()  .setBlockIncrement(3 * 24);
        scroll.getVerticalScrollBar()  .setUnitIncrement (3 * 24);

        add(scroll);

        pack();
        setSize(new Dimension(512, 512));
        setMinimumSize(new Dimension(6 * 24, 6 * 24));

        setVisible(true);
    }