javax.swing.JMenu.setName()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中javax.swing.JMenu.setName()方法的一些代码示例,展示了JMenu.setName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenu.setName()方法的具体详情如下:
包路径:javax.swing.JMenu
类名称:JMenu
方法名:setName

JMenu.setName介绍

暂无

代码示例

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

/**
 * Make a menu from a resource string.
 * @param resource used to name menu and set text.
 * @return the menu
 */
private static JMenu makeMenuRes(String resource) {
  JMenu menu = new JMenu(JMeterUtils.getResString(resource));
  menu.setName(resource);
  return menu;
}

代码示例来源:origin: com.eas.platypus/platypus-js-forms

@ScriptFunction
@Override
public void setName(String name) {
  super.setName(name);
}

代码示例来源:origin: stackoverflow.com

JPopupMenu popup = new JPopupMenu();
popup.setName("popup");
JMenu jMenu= new JMenu("menu");
jMenu.setName("menu");
JMenuItem menuItem1 = new JMenuItem("sub1");
jMenu.add(menuItem1);
menuItem1.addActionListener(this);
popup.add(jMenu);

代码示例来源:origin: stackoverflow.com

JPopupMenu popup = new JPopupMenu();
popup.setName("popup");
JMenu jMenu= new JMenu("menu");
jMenu.setName("menu");
JMenuItem menuItem1 = new JMenuItem("sub1");
jMenu.add(menuItem1);
menuItem1.addActionListener(this);
popup.add(jMenu);

代码示例来源:origin: stackoverflow.com

JPopupMenu popup = new JPopupMenu();
popup.setName("popup");
JMenu jMenu= new JMenu("menu");
jMenu.setName("menu");
JMenuItem menuItem1 = new JMenuItem("sub1");
jMenu.add(menuItem1);
menuItem1.addActionListener(this);
popup.add(jMenu);

代码示例来源:origin: iTransformers/netTransformer

private void createDiscoveryMenu(TopologyManagerFrame frame, JMenuBar menuBar) {
  final JMenu discovery = new JMenu("Discover");
  discovery.setName("Discover");
  discovery.setEnabled(false);
  menuBar.add(discovery);
  final JMenuItem startDiscoveryWizard = new JMenuItem("Discovery Wizard");
  startDiscoveryWizard.addActionListener(startDiscoveryWizardMenuHandler);
  discovery.add(startDiscoveryWizard);
  final JMenuItem startDiscovery = new JMenuItem("Discover Now!");
  startDiscovery.addActionListener(new StartDiscoveryMenuHandler(frame));
  discovery.add(startDiscovery);
}
private void createPreferencesMenu(TopologyManagerFrame frame, JMenuBar menuBar) {

代码示例来源:origin: cpesch/RouteConverter

public static JMenu createMenu(String name) {
  JMenu menu = new JMenu(getString(name + "-menu"));
  menu.setName(name);
  String mnemonic = getOptionalString(name + "-menu-mnemonic");
  if (mnemonic != null && mnemonic.length() > 0)
    menu.setMnemonic(mnemonic.charAt(0));
  return menu;
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createScriptTxtVCS() {
  $objectMap.put("scriptTxtVCS", scriptTxtVCS = new JMenu());
  
  scriptTxtVCS.setName("scriptTxtVCS");
  scriptTxtVCS.setText(t("isisfish.script.menu.txtVCS"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createScriptTxtCode() {
  $objectMap.put("scriptTxtCode", scriptTxtCode = new JMenu());
  
  scriptTxtCode.setName("scriptTxtCode");
  scriptTxtCode.setText(t("isisfish.script.menu.code"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createScriptTxtEdit() {
  $objectMap.put("scriptTxtEdit", scriptTxtEdit = new JMenu());
  
  scriptTxtEdit.setName("scriptTxtEdit");
  scriptTxtEdit.setText(t("isisfish.script.menu.edit"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createScriptNewMenu() {
  $objectMap.put("scriptNewMenu", scriptNewMenu = new JMenu());
  
  scriptNewMenu.setName("scriptNewMenu");
  scriptNewMenu.setText(t("isisfish.script.menu.new"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createExportMenu() {
  $objectMap.put("exportMenu", exportMenu = new JMenu());
  
  exportMenu.setName("exportMenu");
  exportMenu.setText(t("isisfish.result.export"));
}

代码示例来源:origin: fr.ifremer/isis-fish

protected void createScriptTxtFile() {
  $objectMap.put("scriptTxtFile", scriptTxtFile = new JMenu());
  
  scriptTxtFile.setName("scriptTxtFile");
  scriptTxtFile.setText(t("isisfish.script.menu.file"));
}

代码示例来源:origin: tflobbe/solrmeter

private JMenu createToolsMenu() {
  JMenu menu = new JMenu(I18n.get("menu.tools"));
  menu.setName("toolsMenu");
  menu.add(this.createExtractFromLogMenuItem());
  return menu;
}

代码示例来源:origin: iTransformers/netTransformer

private void createModelsMenu(TopologyManagerFrame frame, JMenuBar menuBar) {
  final JMenu models = new JMenu("Network Models");
  models.setEnabled(false);
  models.setName("Network Models");
  menuBar.add(models);
  final JMenuItem reviewNetworkCentricModel = new JMenuItem("Tree viewer");
  reviewNetworkCentricModel.addActionListener(new XmlTreeNetworkGraphmlMenuHandler(frame));
  models.add(reviewNetworkCentricModel);
  final JMenuItem editNetworkCentricModel = new JMenuItem("Data viewer");
  editNetworkCentricModel.addActionListener(new EditNetworkGraphmlMenuHandler(frame));
  models.add(editNetworkCentricModel);
}
private void createGraphToolsMenu(TopologyManagerFrame frame, JMenuBar menuBar) {

代码示例来源:origin: tflobbe/solrmeter

private JMenu createEditMenu() {
  JMenu menu = new JMenu(I18n.get("menu.edit"));
  menu.setName("editMenu");
  menu.add(this.createRestartTestMenuItem());
  menu.add(this.createSettingsMenuItem());
  return menu;
}

代码示例来源:origin: tflobbe/solrmeter

private JMenu createFileMenu() {
  JMenu menu = new JMenu(I18n.get("menu.file"));
  menu.setName("fileMenu");
  menu.add(this.createImportConfigurationMenuItem());
  menu.add(this.createExportConfigurationMenuItem());
  menu.addSeparator();
  menu.add(this.getMenuItemExit());
  return menu;
}

代码示例来源:origin: com.anrisoftware.prefdialog/prefdialog-misc-swing

@Inject
void setIconSizeAction(IconSizeAction action) {
  menuActions.put(ICON_SIZE_NAME, action);
  menu.getIconSizeMenu().setName(ICON_SIZE_NAME);
  menu.getIconSizeMenu().setAction(action);
}

代码示例来源:origin: net.sf.doolin/doolin-gui

/**
 * Creates a {@link JMenu} with the given name and label.
 * 
 * @param name
 *            Identifier for the {@link JMenu}
 * @param label
 *            Label for the {@link JMenu}
 * @return Configured menu
 * @see MnemonicInfo#configureButton(javax.swing.AbstractButton)
 */
protected JMenu createMenu(String name, String label) {
  JMenu menu = new JMenu();
  MnemonicInfo info = new MnemonicInfo(label);
  info.configureButton(menu);
  menu.setName(name);
  return menu;
}

代码示例来源:origin: JChemPaint/jchempaint

/**
 *  Creates a JMenu given by a String with all the MenuItems specified in the
 *  properties file.
 *
 * @param  key       The String used to identify the Menu
 * @param  jcpPanel  Description of the Parameter
 * @param  isPopup   Tells if this menu will be a popup one or not
 * @param  guiString The string identifying the gui to build (i. e. the properties file to use)
  * @param  blacklist       A list of menuitesm/buttons which should be ignored when building gui.
 * @return           The created JMenu
 */
protected JComponent createMenu(AbstractJChemPaintPanel jcpPanel, String key, boolean isPopup, String guiString, List<String> blacklist) {
  logger.debug("Creating menu: ", key);
  JMenu menu = new JMenu(jcpPanel.getMenuTextMaker().getText(key));
  menu.setName(key);
  return createMenu(jcpPanel, key, isPopup, guiString, menu, blacklist);
}

相关文章