Here you can find the source of createJCheckBoxMenuItem(String name, String command, ActionListener listener, boolean isSelected)
public static JCheckBoxMenuItem createJCheckBoxMenuItem(String name, String command, ActionListener listener, boolean isSelected)
//package com.java2s; import java.awt.event.ActionListener; import javax.swing.JCheckBoxMenuItem; public class Main { /**//from w ww.jav a 2 s . com * Creates a check box menu item with specified name, acton command and state. */ public static JCheckBoxMenuItem createJCheckBoxMenuItem(String name, String command, ActionListener listener, boolean isSelected) { JCheckBoxMenuItem item = new JCheckBoxMenuItem(name); item.setActionCommand(command); item.addActionListener(listener); item.setSelected(isSelected); return item; } /** * Creates a check box menu item with specified name and acton command. */ public static JCheckBoxMenuItem createJCheckBoxMenuItem(String name, String command, ActionListener listener) { return createJCheckBoxMenuItem(name, command, listener, false); } }