Codota Logo
JCheckBoxMenuItem.setActionCommand
Code IndexAdd Codota to your IDE (free)

How to use
setActionCommand
method
in
javax.swing.JCheckBoxMenuItem

Best Java code snippets using javax.swing.JCheckBoxMenuItem.setActionCommand (Showing top 20 results out of 315)

  • Common ways to obtain JCheckBoxMenuItem
private void myMethod () {
JCheckBoxMenuItem j =
  • Codota Iconnew JCheckBoxMenuItem()
  • Codota IconString str;new JCheckBoxMenuItem(str)
  • Codota IconAction action;new JCheckBoxMenuItem(action)
  • Smart code suggestions by Codota
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Create a JCheckBoxMenuItem labelled with text for the given property key.
 * 
 * @param key
 *            property key
 * @param actionCommand
 *            internal command
 * @return JCheckBoxMenuItem
 */
private JCheckBoxMenuItem makeCheckBoxMenuItem(String key, String actionCommand) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(Config.language.getProperty(key));
  item.setActionCommand(actionCommand);
  item.addActionListener(this);
  return item;
}
origin: net.sourceforge.ondex.apps/ovtk2

/**
 * Create a JCheckBoxMenuItem labelled with text for the given property key.
 * 
 * @param key
 *            property key
 * @param actionCommand
 *            internal command
 * @return JCheckBoxMenuItem
 */
private JCheckBoxMenuItem makeCheckBoxMenuItem(String key, String actionCommand) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(Config.language.getProperty(key));
  item.setActionCommand(actionCommand);
  item.addActionListener(desktop);
  return item;
}
origin: chatty/chatty

/**
 * Adds a CheckboxMenuItem to a menu.
 * 
 * @param menu The Menu to which the item is added
 * @param key The key this item is associated with (the setting)
 * @param label The text of the item
 * @return The created MenuItem
 */
public final JMenuItem addCheckboxItem(JMenu menu, String key, String label) {
  JCheckBoxMenuItem item = new JCheckBoxMenuItem(label);
  menuItems.put(key, item);
  item.setActionCommand(key);
  menu.add(item);
  item.addItemListener(itemListener);
  return item;
}

origin: MegaMek/mekhq

  private JCheckBoxMenuItem newCheckboxMenu(String text, String command, boolean selected, boolean enabled) {
    JCheckBoxMenuItem result = new JCheckBoxMenuItem(text);
    result.setSelected(selected);
    result.setActionCommand(command);
    result.addActionListener(this);
    result.setEnabled(true);
    return result;
  }
}
origin: org.apache.jmeter/ApacheJMeter_core

  private static JCheckBoxMenuItem makeCheckBoxMenuItemRes(String resource,
      String actionCommand, KeyStroke keyStroke){
    JCheckBoxMenuItem cbkMenuItem = new JCheckBoxMenuItem(JMeterUtils.getResString(resource));
    cbkMenuItem.setName(resource);
    cbkMenuItem.setActionCommand(actionCommand);
    cbkMenuItem.setAccelerator(keyStroke);
    cbkMenuItem.addActionListener(ActionRouter.getInstance());
    return cbkMenuItem;
  }
}
origin: chatty/chatty

@Override
public void showMenu(AddressbookEntry entry, Component invoker, int x, int y) {
  currentEntry = entry;
  removeAll();
  List<String> presetCategories = addressbook.getCategories();
  Set<String> categories = entry.getCategories();
  for (String cat : presetCategories) {
    boolean selected = categories.contains(cat);
    JCheckBoxMenuItem item = new JCheckBoxMenuItem(cat, selected);
    item.addActionListener(actionListener);
    item.setActionCommand(cat);
    add(item);
  }
  this.show(invoker, x, y);
}

origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

@Override
protected void initColumnSelectorItems() {
  cornerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnCount; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    cornerPopup.add(menuItem);
  }
  cornerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  cornerPopup.add(filterMenuItem);
  cornerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: MegaMek/mekhq

private void refreshThemeChoices() {
  menuThemes.removeAll();
  JCheckBoxMenuItem miPlaf;
  for (LookAndFeelInfo plaf : UIManager.getInstalledLookAndFeels()) {
    miPlaf = new JCheckBoxMenuItem(plaf.getName());
    if (plaf.getName().equalsIgnoreCase(
        UIManager.getLookAndFeel().getName())) {
      miPlaf.setSelected(true);
    }
    menuThemes.add(miPlaf);
    miPlaf.setActionCommand(plaf.getClassName());
    miPlaf.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        changeTheme(evt);
      }
    });
  }
}
//TODO: trigger from event
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  headerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < columnNames.length; i++) {
    menuItem = new JCheckBoxMenuItem(columnNames[i]);
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (resTable != null) {
      menuItem.setState(resTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    headerPopup.add(menuItem);
  }
  headerPopup.addSeparator();
  JCheckBoxMenuItem filterMenuItem = new JCheckBoxMenuItem(FILTER_MENU_ITEM_NAME);
  filterMenuItem.setActionCommand("Filter"); // NOI18N
  addMenuItemListener(filterMenuItem);
  if (filterComponent == null) {
    filterMenuItem.setState(true);
  } else {
    filterMenuItem.setState(filterComponent.getComponent().isVisible());
  }
  headerPopup.add(filterMenuItem);
  headerPopup.pack();
}
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

protected void initColumnSelectorItems() {
  cornerPopup.removeAll();
  JCheckBoxMenuItem menuItem;
  for (int i = 0; i < realTreeTableModel.getColumnCount(); i++) {
    menuItem = new JCheckBoxMenuItem(realTreeTableModel.getColumnName(i));
    menuItem.setActionCommand(Integer.valueOf(i).toString());
    addMenuItemListener(menuItem);
    if (treeTable != null) {
      menuItem.setState(treeTableModel.isRealColumnVisible(i));
      if (i == 0) {
        menuItem.setEnabled(false);
      }
    } else {
      menuItem.setState(true);
    }
    cornerPopup.add(menuItem);
  }
  cornerPopup.pack();
}

origin: org.bitbucket.goalhub.simpleide/jedit

  "vfs.browser.commands.encoding.auto-detect"));
autoDetect.setSelected(browser.autoDetectEncoding);
autoDetect.setActionCommand("auto-detect");
autoDetect.addActionListener(actionHandler);
menu.add(autoDetect);
origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

  menuItem.setActionCommand(Integer.valueOf(i).toString());
  addMenuItemListener(menuItem);
filterMenuItem.setActionCommand("Filter"); // NOI18N
addMenuItemListener(filterMenuItem);
origin: org.fudaa.framework.ebli/ebli-3d

public final JMenuItem addMenuItem(final String _s, final String _cmd, final boolean _enabled, final boolean _value) {
 // BuIcon icon=BuLib.loadCommandIcon(_cmd);
 final JCheckBoxMenuItem r = new JCheckBoxMenuItem();
 r.setName("cb" + _cmd);
 r.setActionCommand(_cmd);
 r.setText(_s);
 // r.setIcon(icon);
 r.setHorizontalTextPosition(SwingConstants.RIGHT);
 r.addActionListener(this);
 r.setEnabled(_enabled);
 r.setSelected(_value);
 this.add(r);
 return r;
}
origin: MegaMek/mekhq

  cbMenuItem.setSelected(true);
} else {
  cbMenuItem.setActionCommand("CHANGE_MODE:" + wt.id);
  cbMenuItem.addActionListener(this);
origin: net.sf.mmax2/mmax2

fancy.setFont(MMAX2.getStandardFont());
fancy.addActionListener(this);
fancy.setActionCommand("fancy");
settingsMenu.add(fancy);
activeOnly.setFont(MMAX2.getStandardFont());
activeOnly.addActionListener(this);
activeOnly.setActionCommand("activeOnly");
settingsMenu.add(activeOnly);
group.setFont(MMAX2.getStandardFont());
group.addActionListener(this);
group.setActionCommand("group");
settingsMenu.add(group);
javax.swingJCheckBoxMenuItemsetActionCommand

Popular methods of JCheckBoxMenuItem

  • <init>
  • setSelected
  • addActionListener
  • isSelected
  • setEnabled
  • setState
  • setText
  • getState
  • addItemListener
  • setMnemonic
  • setToolTipText
  • setAccelerator
  • setToolTipText,
  • setAccelerator,
  • setAction,
  • getText,
  • setIcon,
  • setName,
  • getModel,
  • addChangeListener,
  • getActionCommand

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getContentResolver (Context)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • Point (java.awt)
    A point representing a location in (x, y) coordinate space, specified in integer precision.
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Collectors (java.util.stream)
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now