當前位置: 首頁>>代碼示例>>Java>>正文


Java JMenu.setText方法代碼示例

本文整理匯總了Java中javax.swing.JMenu.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java JMenu.setText方法的具體用法?Java JMenu.setText怎麽用?Java JMenu.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JMenu的用法示例。


在下文中一共展示了JMenu.setText方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: PopuleBarra

import javax.swing.JMenu; //導入方法依賴的package包/類
public void PopuleBarra(JMenu obj) {
    int i = 0;
    for (ConfigAcao ca : Lista) {
        if (ca.tipo == TipoConfigAcao.tpMenuBarra || ca.tipo == TipoConfigAcao.tpAny) {
            Acao ac = new Acao(editor, ca.texto, ca.ico, ca.descricao, ca.command);
            ac.IDX = i++;
            JMenuItem mi = new JMenuItem(ac);
            //obj.add(mi);
            listaMenus.put(ca.command, mi);
            //ListaDeAcoes.add(ac);
        }
    }
    obj.setText(Editor.fromConfiguracao.getValor("Controler.interface.menu.menuDiagrama.texto"));
    char b = Editor.fromConfiguracao.getValor("Controler.interface.menu.menuDiagrama.mtecla").charAt(0);
    obj.setMnemonic(b);
    BarraMenu = obj;
}
 
開發者ID:chcandido,項目名稱:brModelo,代碼行數:18,代碼來源:Controler.java

示例2: createJdkSubmenu

import javax.swing.JMenu; //導入方法依賴的package包/類
@Messages("ActionMappings.jdkVar=Use JDK for Maven build")
private static JMenu createJdkSubmenu(JTextComponent area) {
    JMenu menu = new JMenu();
    menu.setText(ActionMappings_jdkVar());
    boolean hasAny = false;
    for (JavaPlatform platform : JavaPlatformManager.getDefault().getInstalledPlatforms()) {
        hasAny = true;
        if (platform.getInstallFolders().size() > 0) {
            menu.add(new JdkAction(area, platform.getDisplayName(), platform.getInstallFolders().iterator().next()));
        }
    }
    if (!hasAny) {
        menu.setEnabled(false);
    }
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:ActionMappings.java

示例3: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_IgnoreMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:IgnoreMenu.java

示例4: createExploreMenu

import javax.swing.JMenu; //導入方法依賴的package包/類
/**
 * Creates and returns an exploration menu for the menu bar.
 */
private JMenu createExploreMenu() {
    JMenu result = new JMenu();
    result.setMnemonic(Options.EXPLORE_MENU_MNEMONIC);
    result.setText(Options.EXPLORE_MENU_NAME);
    result.add(getActions().getExplorationDialogAction());
    result.addSeparator();
    result.add(getActions().getStartSimulationAction());
    result.add(getActions().getApplyMatchAction());
    result.add(getActions().getAnimateAction());
    result.add(getActions().getExploreAction());
    result.addSeparator();
    result.add(getActions().getBackAction());
    result.add(getActions().getForwardAction());
    result.add(getActions().getGotoStartStateAction());
    result.add(getActions().getGotoFinalStateAction());
    result.addSeparator();
    result.add(getActions().getSaveLTSAsAction());
    result.addSeparator();
    result.add(getActions().getExplorationStatsDialogAction());
    return result;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:25,代碼來源:Simulator.java

示例5: initializeMenus

import javax.swing.JMenu; //導入方法依賴的package包/類
private void initializeMenus () {
	{
		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);
		{
			JMenu fileMenu = new JMenu();
			menuBar.add(fileMenu);
			fileMenu.setText("File");
			fileMenu.setMnemonic(KeyEvent.VK_F);
			{
				openMenuItem = new JMenuItem("Open Hiero settings file...");
				openMenuItem.setMnemonic(KeyEvent.VK_O);
				openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK));
				fileMenu.add(openMenuItem);
			}
			{
				saveMenuItem = new JMenuItem("Save Hiero settings file...");
				saveMenuItem.setMnemonic(KeyEvent.VK_S);
				saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_MASK));
				fileMenu.add(saveMenuItem);
			}
			fileMenu.addSeparator();
			{
				saveBMFontMenuItem = new JMenuItem("Save BMFont files (text)...");
				saveBMFontMenuItem.setMnemonic(KeyEvent.VK_B);
				saveBMFontMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, KeyEvent.CTRL_MASK));
				fileMenu.add(saveBMFontMenuItem);
			}
			fileMenu.addSeparator();
			{
				exitMenuItem = new JMenuItem("Exit");
				exitMenuItem.setMnemonic(KeyEvent.VK_X);
				fileMenu.add(exitMenuItem);
			}
		}
	}
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:38,代碼來源:Hiero.java

示例6: createGlobalVarSubmenu

import javax.swing.JMenu; //導入方法依賴的package包/類
@Messages("ActionMappings.globalVar=Reference IDE Global Variable")
private static JMenu createGlobalVarSubmenu(JTextComponent area) {
    JMenu menu = new JMenu();
    menu.setText(ActionMappings_globalVar());
    Map<String, String> vars = DefaultReplaceTokenProvider.readVariables();
    boolean hasAny = false;
    for (Map.Entry<String, String> ent : vars.entrySet()) {
        hasAny = true;
        menu.add(new UseGlobalVarAction(area, ent.getKey()));
    }
    if (!hasAny) {
        menu.setEnabled(false);
    }
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:ActionMappings.java

示例7: createFileSelectionSubmenu

import javax.swing.JMenu; //導入方法依賴的package包/類
@Messages("ActionMappings.fileExpressions=IDE Selection Expressions")
private static JMenu createFileSelectionSubmenu(JTextComponent area) {
    JMenu menu = new JMenu();
    menu.setText(ActionMappings_fileExpressions());
    menu.add(new FileVariableAction(area, "packageClassName"));
    menu.add(new FileVariableAction(area, "className"));
    menu.add(new FileVariableAction(area, "classNameWithExtension"));
    menu.add(new FileVariableAction(area, "webPagePath"));
    menu.add(new FileVariableAction(area, "classPathScope"));
    menu.add(new FileVariableAction(area, "absolutePathName"));
        
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:ActionMappings.java

示例8: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
@Messages({"ACT_Show=Show in POM", 
    "# {0} - artifactid of a project",
    "ACT_Current=Current: {0}",
    "# {0} - artifactid of a project",
    "ACT_PARENT=Parent: {0}"})
public JMenuItem getPopupPresenter() {
    JMenu menu = new JMenu();
    menu.setText(ACT_Show());
    POMCutHolder pch = node.getLookup().lookup(POMCutHolder.class);
    POMModel[] mdls = pch.getSource();
    Object[] val = pch.getCutValues();
    int index = 0;
    for (POMModel mdl : mdls) {
        String artifact = mdl.getProject().getArtifactId();
        JMenuItem item = new JMenuItem();
        item.setAction(new SelectAction(node, index));
        if (index == 0) {
            item.setText(ACT_Current(artifact != null ? artifact : "project"));
        } else {
            item.setText(ACT_PARENT(artifact != null ? artifact : "project"));
        }
        item.setEnabled(/* #199345 */index < val.length && val[index] != null);
        menu.add(item);
        index++;
    }
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:29,代碼來源:POMModelVisitor.java

示例9: createMenu

import javax.swing.JMenu; //導入方法依賴的package包/類
public JMenu createMenu (String containerContext) {
    System.err.println("Creating a menu: " + containerContext);
    JMenu result = new JMenu();
    result.putClientProperty (KEY_CONTAINERCONTEXT, containerContext);
    result.setName(containerContext);
    result.setText (getEngine().getContainerProvider().getDisplayName(
        ContainerProvider.TYPE_MENU, containerContext));
    populateMenu(containerContext, result); //XXX listener should do this
    attachToMenu(result);
    return result;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:AbstractMenuFactory.java

示例10: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_PatchesMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:PatchesMenu.java

示例11: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_RemoteMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:RemoteMenu.java

示例12: getMenuPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getMenuPresenter () {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_DiffMenu_Popup());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:DiffMenu.java

示例13: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_ConflictsMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:ConflictsMenu.java

示例14: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_BranchMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:BranchMenu.java

示例15: getPopupPresenter

import javax.swing.JMenu; //導入方法依賴的package包/類
@Override
public JMenuItem getPopupPresenter() {
    JMenu menu = createMenu();
    menu.setText(Bundle.CTL_MenuItem_QueuesMenu_popupName());
    enableMenu(menu);
    return menu;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:QueuesMenu.java


注:本文中的javax.swing.JMenu.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。