private static JMenu getFileJMenu() {
		JMenu fileJMenu = new JMenu("File");

		JMenuItem newGraphJMenuItem = new JMenuItem("New graph");
		JMenuItem saveJMenuItem = new JMenuItem("Save");
		JMenuItem loadMenuItem = new JMenuItem("Load");
		JMenuItem quitJMenuItem = new JMenuItem("Quit");

		newGraphJMenuItem.setToolTipText("Create a new graph.");
		saveJMenuItem.setToolTipText("Save this graph to a file.");
		loadMenuItem.setToolTipText("Load a graph from a file.");
		quitJMenuItem.setToolTipText("Quit the program.");

		// Add action listeners.
		newGraphJMenuItem.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				switch (JOptionPane.showConfirmDialog(frame,
						"Save this graph before creating new empty one?")) {
				case JOptionPane.YES_OPTION:
					saveGraph();
				case JOptionPane.NO_OPTION:
					vertexSet = new VertexSet();
					graphPanel.repaint();
					break;
				case JOptionPane.CANCEL_OPTION:
					break;
				default: // Do nothing.
				}
			}
		});

		saveJMenuItem.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				saveGraph();
			}
		});

		loadMenuItem.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				switch (JOptionPane.showConfirmDialog(frame,
						"Save this graph before loading a new one?")) {
				case JOptionPane.YES_OPTION:
					saveGraph();
				case JOptionPane.NO_OPTION:
					loadGraph();
					graphPanel.repaint();
					break;
				case JOptionPane.CANCEL_OPTION:
					break;
				default: // Do nothing.
				}
			}
		});

		quitJMenuItem.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent e) {
				switch (JOptionPane.showConfirmDialog(frame,
						"Save this graph before quitting the program?")) {
				case JOptionPane.YES_OPTION:
					saveGraph();
				case JOptionPane.NO_OPTION:
					// Quit
					vertexSet.stopPositioningVertices();
					frame.dispose();
					System.exit(0);
					break;
				case JOptionPane.CANCEL_OPTION:
					break;
				default: // Do nothing.
				}
			}
		});

		fileJMenu.add(newGraphJMenuItem);
		fileJMenu.add(saveJMenuItem);
		fileJMenu.add(loadMenuItem);
		fileJMenu.add(quitJMenuItem);

		return fileJMenu;
	}