addBag(lisTerrain, gridbag, c);
addBag(new JScrollPane(lisTerrain), gridbag, c);
    private void setupEditorPanel() {        canHex = new HexCanvas();        labElev = new JLabel(Messages.getString("BoardEditor.labElev"), JLabel.RIGHT); //$NON-NLS-1$        texElev = new JTextField("0", 1); //$NON-NLS-1$        texElev.addActionListener(this);        texElev.getDocument().addDocumentListener(this);        butElevUp = new JButton(Messages.getString("BoardEditor.butElevUp")); //$NON-NLS-1$        butElevUp.addActionListener(this);        butElevDown = new JButton(Messages.getString("BoardEditor.butElevDown")); //$NON-NLS-1$        butElevDown.addActionListener(this);        labTerrain = new JLabel(Messages.getString("BoardEditor.labTerrain"), JLabel.LEFT); //$NON-NLS-1$        lisTerrain = new List(6);        lisTerrain.addItemListener(this);        refreshTerrainList();        butDelTerrain = new JButton(Messages.getString("BoardEditor.butDelTerrain")); //$NON-NLS-1$        butDelTerrain.addActionListener(this);        String[] terrainArray = new String[Terrains.SIZE - 1];        for (int i = 1; i < Terrains.SIZE; i++) {            terrainArray[i - 1] = Terrains.getName(i);        }        choTerrainType = new JComboBox(terrainArray);        texTerrainLevel = new JTextField("0", 1); //$NON-NLS-1$        butAddTerrain = new JButton(Messages.getString("BoardEditor.butAddTerrain")); //$NON-NLS-1$        butAddTerrain.addActionListener(this);        butMiniMap = new JButton(Messages.getString("BoardEditor.butMiniMap")); //$NON-NLS-1$        butMiniMap.setActionCommand("viewMiniMap"); //$NON-NLS-1$        butMiniMap.addActionListener(this);        panTerrainType = new JPanel(new BorderLayout());        panTerrainType.add(choTerrainType, BorderLayout.WEST);        panTerrainType.add(texTerrainLevel, BorderLayout.CENTER);        cheTerrExitSpecified = new JCheckBox(Messages.getString("BoardEditor.cheTerrExitSpecified")); //$NON-NLS-1$        butTerrExits = new JButton(Messages.getString("BoardEditor.butTerrExits")); //$NON-NLS-1$        texTerrExits = new JTextField("0", 1); //$NON-NLS-1$        butTerrExits.addActionListener(this);        panTerrExits = new JPanel(new FlowLayout());        panTerrExits.add(cheTerrExitSpecified);        panTerrExits.add(butTerrExits);        panTerrExits.add(texTerrExits);        panRoads = new JPanel(new FlowLayout());        cheRoadsAutoExit = new JCheckBox(Messages.getString("BoardEditor.cheRoadsAutoExit")); //$NON-NLS-1$        cheRoadsAutoExit.addItemListener(this);        panRoads.add(cheRoadsAutoExit);        labTheme = new JLabel(Messages.getString("BoardEditor.labTheme"), JLabel.LEFT); //$NON-NLS-1$        texTheme = new JTextField("", 15); //$NON-NLS-1$        texTheme.getDocument().addDocumentListener(this);        labBoard = new JLabel(Messages.getString("BoardEditor.labBoard"), JLabel.LEFT); //$NON-NLS-1$        butBoardNew = new JButton(Messages.getString("BoardEditor.butBoardNew")); //$NON-NLS-1$        butBoardNew.setActionCommand("fileBoardNew"); //$NON-NLS-1$        butBoardNew.addActionListener(this);        butBoardLoad = new JButton(Messages.getString("BoardEditor.butBoardLoad")); //$NON-NLS-1$        butBoardLoad.setActionCommand("fileBoardOpen"); //$NON-NLS-1$        butBoardLoad.addActionListener(this);        butBoardSave = new JButton(Messages.getString("BoardEditor.butBoardSave")); //$NON-NLS-1$        butBoardSave.setActionCommand("fileBoardSave"); //$NON-NLS-1$        butBoardSave.addActionListener(this);        butBoardSaveAs = new JButton(Messages.getString("BoardEditor.butBoardSaveAs")); //$NON-NLS-1$        butBoardSaveAs.setActionCommand("fileBoardSaveAs"); //$NON-NLS-1$        butBoardSaveAs.addActionListener(this);        butBoardSaveAsImage = new JButton(Messages.getString("BoardEditor.butBoardSaveAsImage")); //$NON-NLS-1$        butBoardSaveAsImage.setActionCommand("fileBoardSaveAsImage"); //$NON-NLS-1$        butBoardSaveAsImage.addActionListener(this);        panButtons = new JPanel(new GridLayout(3, 2, 2, 2));        panButtons.add(labBoard);        panButtons.add(butBoardNew);        panButtons.add(butBoardLoad);        panButtons.add(butBoardSave);        panButtons.add(butBoardSaveAs);        panButtons.add(butBoardSaveAsImage);        blankL = new JLabel("", JLabel.CENTER); //$NON-NLS-1$        GridBagLayout gridbag = new GridBagLayout();        GridBagConstraints c = new GridBagConstraints();        setLayout(gridbag);        c.fill = GridBagConstraints.HORIZONTAL;        c.weightx = 0.0;        c.weighty = 0.0;        c.insets = new Insets(4, 4, 1, 1);        c.gridwidth = GridBagConstraints.REMAINDER;        addBag(canHex, gridbag, c);        c.gridwidth = 1;        addBag(labElev, gridbag, c);        addBag(butElevUp, gridbag, c);        addBag(butElevDown, gridbag, c);        c.gridwidth = GridBagConstraints.REMAINDER;        addBag(texElev, gridbag, c);        addBag(labTerrain, gridbag, c);        addBag(lisTerrain, gridbag, c);        addBag(butDelTerrain, gridbag, c);        addBag(panTerrainType, gridbag, c);        addBag(panTerrExits, gridbag, c);        addBag(panRoads, gridbag, c);        addBag(labTheme, gridbag, c);        addBag(texTheme, gridbag, c);        addBag(butAddTerrain, gridbag, c);        addBag(butMiniMap, gridbag, c);        c.weightx = 1.0;        c.weighty = 1.0;        addBag(blankL, gridbag, c);        c.weightx = 1.0;        c.weighty = 0.0;        //        addBag(labBoard, gridbag, c);        addBag(panButtons, gridbag, c);        minimapW = new JDialog(frame, Messages.getString("BoardEditor.minimapW"), false); //$NON-NLS-1$        minimapW.setLocation(GUIPreferences.getInstance().getMinimapPosX(), GUIPreferences.getInstance().getMinimapPosY());        try {            minimap = new MiniMap(minimapW, game, bv);        } catch (IOException e) {            JOptionPane.showMessageDialog(frame, Messages.getString("BoardEditor.CouldNotInitialiseMinimap") + e, Messages.getString("BoardEditor.FatalError"), JOptionPane.ERROR_MESSAGE); //$NON-NLS-1$ //$NON-NLS-2$            frame.dispose();        }        minimapW.add(minimap);        setMapVisible(true);    }