How can I add a check mark next to a menu item after it's been selected?

I have the following code which shows a menu called “Options” and under it are the menu items “AI Mode” and “Player Mode”. I just want to know how I can mark each one of these with a check mark when chosen.


package com.sean.breakout.menu;

import javax.swing.*;

public class MenuBar extends JMenuBar {
	
	private static final long serialVersionUID = 1L;
	
	public MenuBar() {
		add(createOptionsMenu());	
	}

	private JMenu createOptionsMenu() {
		JMenu fileOptions = new JMenu("Options");
		JMenuItem aiMode = new JMenuItem("AI Mode");
		JMenuItem playerMode = new JMenuItem("Player Mode");
		fileOptions.add(aiMode);
		fileOptions.add(playerMode);
		return fileOptions;
	}
	
}