private void createMenus() {
        jMenuBar1 = new javax.swing.JMenuBar();
        fileMenu = new SFMenu();
        importMenuItem = new SFMenuItem();
        quitMenuItem = new SFMenuItem();
        editMenu = new javax.swing.JMenu();
        displaysMenu = new JMenu("Displays");
        
        editMenu.getPopupMenu().setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
        displaysMenu.getPopupMenu().setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));
        fileMenu.getPopupMenu().setBorder(BorderFactory.createLineBorder(Color.LIGHT_GRAY));

        
        //The following two menu items appear at the bottom of the displays menu, and are
        //created here but attached in the remakeDisplaysMenu function
        reattachAllDisplays = new JMenuItem("Reattach all");
        reattachAllDisplays.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				reattachAllDisplays();
			}
        });
        
        closeAllDisplays = new SFMenuItem("Close all");
        closeAllDisplays.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				closeAllDisplays();
			}
        });
        remakeDisplaysMenu();
        
        fileMenu.setText("File");

        JMenuItem newItem = new SFMenuItem();
        newItem.setText("New...");
       	newItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_N, getCommandMask()));
        newItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	System.out.println("New action not implemented yet");
            }
        });
        fileMenu.add(newItem);
        fileMenu.add(importMenuItem);
        
        importMenuItem.setText("Open");
        importMenuItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_O, getCommandMask()));
        importMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fileTreePanel.openFileAction();
            }
        });
        fileMenu.add(importMenuItem);
        
        JMenuItem closeItem = new SFMenuItem();
        closeItem.setText("Close");
        closeItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_W, getCommandMask()));
        closeItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeSelectedDisplay();
            }
        });
        fileMenu.add(closeItem);
        
        JMenuItem saveItem = new SFMenuItem("Save");
       	saveItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, getCommandMask()));
        saveItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	Display activeDisplay = defaultDisplayPane.getCurrentDisplay();
            	if (activeDisplay!=null) {
            		try {
						activeDisplay.save();
					} catch (SaveCancelledException e) {
						//User cancelled the save, we don't care.
					}
            	}
            }
        });
        fileMenu.add(saveItem);
        
        JMenuItem saveAsItem = new SFMenuItem("Save as...");
        saveAsItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_S, getCommandMask() + ActionEvent.SHIFT_MASK));
        saveAsItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	Display activeDisplay = defaultDisplayPane.getCurrentDisplay();
            	if (activeDisplay!=null) {
            		try {
						activeDisplay.saveNew();
					} catch (SaveCancelledException e) {
						//User cancelled the save
					}
            	}
            }
        });
        fileMenu.add(saveAsItem);
        fileMenu.add(GTKFixSeparator.makeSeparator());

        
        JMenuItem showParsers = new SFMenuItem("Show all parsers");
        showParsers.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_P, getCommandMask() ));
        showParsers.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	showParserList();
            }
        });
        fileMenu.add(showParsers);

        JMenuItem showDisplays = new SFMenuItem("Show all displays");
        showDisplays.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_D, getCommandMask() ));
        showDisplays.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
            	showDisplayList();
            }
        });
        fileMenu.add(showDisplays);
        
        fileMenu.add(GTKFixSeparator.makeSeparator());
        
        
        jMenuBar1.add(fileMenu);

        editMenu.setText("Edit");
        undoItem = new SFMenuItem("Undo");
        undoItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_Z, getCommandMask()));
        undoItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				UndoableActionSource undoOwner = UndoRedoManager.getUndoFocusOwner();
				if (undoOwner != null)
					undoOwner.getManager().undo();
			}
        });
        
        redoItem = new SFMenuItem("Redo");
        redoItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_R, getCommandMask()));
        redoItem.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				UndoableActionSource undoOwner = UndoRedoManager.getUndoFocusOwner();
				if (undoOwner != null)
					undoOwner.getManager().redo();
			}
        });
        
        JMenuItem cutItem = new JMenuItem(new DefaultEditorKit.CutAction());
        cutItem.setText("Cut");
        cutItem.setMnemonic(KeyEvent.VK_T);
        cutItem.setActionCommand((String)TransferHandler.getCutAction().
                getValue(Action.NAME));
        cutItem.addActionListener(ccpListener);
       	cutItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_X, getCommandMask()));

        JMenuItem copyItem = new JMenuItem(new DefaultEditorKit.CopyAction());
        copyItem.setText("Copy");
        copyItem.setMnemonic(KeyEvent.VK_C);
        copyItem.setActionCommand((String)TransferHandler.getCopyAction().
                getValue(Action.NAME));
        copyItem.addActionListener(ccpListener);
       	copyItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_C, getCommandMask()));

        JMenuItem pasteItem = new JMenuItem(new DefaultEditorKit.PasteAction());
        pasteItem.setText("Paste");
        pasteItem.setMnemonic(KeyEvent.VK_P);
        pasteItem.setActionCommand((String)TransferHandler.getPasteAction().
                getValue(Action.NAME));
        pasteItem.addActionListener(ccpListener);
       	pasteItem.setAccelerator( KeyStroke.getKeyStroke(KeyEvent.VK_V, getCommandMask()));
        
        editMenu.add(undoItem);
        editMenu.add(redoItem);
        editMenu.add(GTKFixSeparator.makeSeparator());
        editMenu.add(cutItem);
        editMenu.add(copyItem);
        editMenu.add(pasteItem);
        
        setUndoState(false, "");
        
        jMenuBar1.add(editMenu);
        
        if (onAMac)  {
        	//This should only be created on mac systems
        	try {
        		sunfish.MacQuitHandler macHandler = new sunfish.MacQuitHandler(this);
        	}
        	catch (Exception ex) {
        		System.err.println("There was an error creating the Mac OS application exit listener.\n This may affect properties file writing on macintosh systems. ");
        		logger.warning("Error creating the Mac OS application exit listener. " + ex);
        	}
        }
        else {	//On non-macs we add a quit 
            quitMenuItem.setText("Quit");
            quitMenuItem.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) { 
                    SunFishApp.getApplication().shutdown();
                }
            });
            fileMenu.add(quitMenuItem);
        }

        
        jMenuBar1.add(displaysMenu);        
        this.setJMenuBar(jMenuBar1);
	}