minimapW.addWindowListener(this);
    private void setupEditorPanel() {        canHex = new HexCanvas();        labElev = new Label(Messages.getString("BoardEditor.labElev"), Label.RIGHT); //$NON-NLS-1$        texElev = new TextField("0", 1); //$NON-NLS-1$        texElev.addActionListener(this);        texElev.addTextListener(this);        butElevUp = new Button(Messages.getString("BoardEditor.butElevUp")); //$NON-NLS-1$        butElevUp.addActionListener(this);        butElevDown = new Button(Messages.getString("BoardEditor.butElevDown")); //$NON-NLS-1$        butElevDown.addActionListener(this);            labTerrain = new Label(Messages.getString("BoardEditor.labTerrain"), Label.LEFT); //$NON-NLS-1$        lisTerrain = new java.awt.List(6);        lisTerrain.addItemListener(this);        refreshTerrainList();                butDelTerrain = new Button(Messages.getString("BoardEditor.butDelTerrain")); //$NON-NLS-1$        butDelTerrain.addActionListener(this);                choTerrainType = new Choice();        for (int i = 1; i < Terrains.SIZE; i++) {            choTerrainType.add(Terrains.getName(i));        }                texTerrainLevel = new TextField("0", 1); //$NON-NLS-1$                butAddTerrain = new Button(Messages.getString("BoardEditor.butAddTerrain")); //$NON-NLS-1$        butAddTerrain.addActionListener(this);                butMiniMap = new Button(Messages.getString("BoardEditor.butMiniMap")); //$NON-NLS-1$        butMiniMap.setActionCommand( "viewMiniMap" ); //$NON-NLS-1$        butMiniMap.addActionListener(this);                panTerrainType = new Panel(new BorderLayout());        panTerrainType.add(choTerrainType, BorderLayout.WEST);        panTerrainType.add(texTerrainLevel, BorderLayout.CENTER);                cheTerrExitSpecified = new Checkbox(Messages.getString("BoardEditor.cheTerrExitSpecified")); //$NON-NLS-1$        butTerrExits = new Button(Messages.getString("BoardEditor.butTerrExits")); //$NON-NLS-1$        texTerrExits = new TextField("0", 1); //$NON-NLS-1$        butTerrExits.addActionListener(this);            panTerrExits = new Panel(new FlowLayout());        panTerrExits.add(cheTerrExitSpecified);        panTerrExits.add(butTerrExits);        panTerrExits.add(texTerrExits);        panRoads = new Panel(new FlowLayout());        cheRoadsAutoExit = new Checkbox(Messages.getString("BoardEditor.cheRoadsAutoExit")); //$NON-NLS-1$        cheRoadsAutoExit.addItemListener( this );        panRoads.add(cheRoadsAutoExit);        labTheme = new Label(Messages.getString("BoardEditor.labTheme"), Label.LEFT); //$NON-NLS-1$        texTheme = new TextField("", 15); //$NON-NLS-1$        texTheme.addTextListener(this);        labBoard = new Label(Messages.getString("BoardEditor.labBoard"), Label.LEFT); //$NON-NLS-1$        butBoardNew = new Button(Messages.getString("BoardEditor.butBoardNew")); //$NON-NLS-1$        butBoardNew.setActionCommand( "fileBoardNew" ); //$NON-NLS-1$        butBoardNew.addActionListener(this);        butBoardLoad = new Button(Messages.getString("BoardEditor.butBoardLoad")); //$NON-NLS-1$        butBoardLoad.setActionCommand( "fileBoardOpen" ); //$NON-NLS-1$        butBoardLoad.addActionListener(this);        butBoardSave = new Button(Messages.getString("BoardEditor.butBoardSave")); //$NON-NLS-1$        butBoardSave.setActionCommand( "fileBoardSave" ); //$NON-NLS-1$        butBoardSave.addActionListener(this);        butBoardSaveAs = new Button(Messages.getString("BoardEditor.butBoardSaveAs")); //$NON-NLS-1$        butBoardSaveAs.setActionCommand( "fileBoardSaveAs" ); //$NON-NLS-1$        butBoardSaveAs.addActionListener(this);        butBoardSaveAsImage = new Button(Messages.getString("BoardEditor.butBoardSaveAsImage")); //$NON-NLS-1$        butBoardSaveAsImage.setActionCommand( "fileBoardSaveAsImage" ); //$NON-NLS-1$        butBoardSaveAsImage.addActionListener(this);        panButtons = new Panel(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 Label("", Label.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 Dialog(frame, Messages.getString("BoardEditor.minimapW"), false); //$NON-NLS-1$        minimapW.setLocation(GUIPreferences.getInstance().getMinimapPosX(), GUIPreferences.getInstance().getMinimapPosY());        minimapW.addWindowListener(this);        try {            minimap = new MiniMap(minimapW, game, bv);        } catch (IOException e) {            new AlertDialog(frame,Messages.getString("BoardEditor.FatalError"), Messages.getString("BoardEditor.CouldNotInitialiseMinimap")+e); //$NON-NLS-1$ //$NON-NLS-2$            frame.dispose();        }        minimapW.add(minimap);        setMapVisible(true);    }