private static JMenu makeFileMenu(final GeomLab app) {
	JMenu menu = new JMenu("File");
        menu.setMnemonic(KeyEvent.VK_F);
        menu.add(new Command("Load...", KeyEvent.VK_L, app) { 
            public void perform() throws CommandException {
        	JFileChooser loadDialog = new MyFileChooser();
		if (loadDialog.showOpenDialog(app.frame) 
			== JFileChooser.APPROVE_OPTION) {
		    File file = loadDialog.getSelectedFile();
		    app.loadFileCommand(file);
		}
            }
        });
        menu.addSeparator();
        menu.add(new Command("Load session ...", KeyEvent.VK_O, app) { 
            public void perform() throws CommandException {
        	JFileChooser loadDialog = new MyFileChooser(".gls");
		if (loadDialog.showOpenDialog(app.frame)
			== JFileChooser.APPROVE_OPTION) {
		    File file = loadDialog.getSelectedFile();
		    Session.loadSession(file);
		    app.logMessage("Loaded session from " + file.getName());
		    app.prompt();
		}
            }
        });
        menu.add(new Command("Save session ...", KeyEvent.VK_S, app) { 
            public void perform() throws CommandException {
        	JFileChooser saveDialog = new MyFileChooser(".gls");
		if (saveDialog.showSaveDialog(app.frame)
			== JFileChooser.APPROVE_OPTION) {
		    File file = saveDialog.getSelectedFile();
		    Session.saveSession(file);
		    app.logMessage("Saved session as " + file.getName());
		    app.prompt();
		}
            }
        }); 
        menu.addSeparator();
        menu.add(new Command("Print image ...", KeyEvent.VK_P, app) { 
            public void perform() throws CommandException {
        	app.arena.print();
            }
        });	
        menu.add(new Command("Image setup ...", KeyEvent.VK_I, app) { 
            public void perform() {
        	JTextField dimField = new JTextField(5);
		JPanel params = new JPanel();
		params.setLayout(new VariGridLayout(1, 2, 2));
		params.add(new JLabel("Mean dimension (pixels):"));
		params.add(dimField);
		dimField.setText(Integer.toString(app.arena.getImageMean()));
		
		int result = JOptionPane.showOptionDialog(
			app.frame, params, "Image parameters", 
			JOptionPane.OK_CANCEL_OPTION,
			JOptionPane.QUESTION_MESSAGE, null, null, null);
		
		if (result == JOptionPane.OK_OPTION)
		    app.arena.setImageMean(
			    Integer.parseInt(dimField.getText()));
            }
        });
        menu.add(new Command("Save image ...", KeyEvent.VK_V, app) { 
            public void perform() throws CommandException {
        	if (! app.arena.isPicture())
		    throw new CommandException("No picture", "#nopicture");
		
		JFileChooser saveDialog = new MyFileChooser(".png");
		if (saveDialog.showSaveDialog(app.frame) 
			== JFileChooser.APPROVE_OPTION) {
		    File file = saveDialog.getSelectedFile();
		    try {
			app.arena.writePicture(file);
		    }
		    catch (IOException e) {
			throw new CommandException(
				"I/O failed while writing " + file.getName(),
				"#picio");
		    }
		}
            }
        }); 
        menu.addSeparator();
        menu.add(new Command("Exit", KeyEvent.VK_X, app) {
            public void perform() { app.exit(); }
        });
	return menu;
    }