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


Java JRadioButtonMenuItem.setText方法代碼示例

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


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

示例1: getTimerMenu

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
/**
 * Get the menu used for this timer
 * @return a JMenu for use by the application
 */
public JMenu getTimerMenu()
{
	JMenu timerMenu = new JMenu("Timer");
	for (Mode m : Mode.values())
	{
		JRadioButtonMenuItem bm = new JRadioButtonMenuItem();
		bm.setActionCommand(m.name());
		bm.addActionListener(this);
		timerMenu.add(bm);
		modeGroup.add(bm);
		switch (m)
		{
			case OFF: bm.setText("Off"); break;
			case BASIC_SERIAL: bm.setText("FarmTek/RaceAmerica/JACircuits"); break;
			case BWTIMER_SERIAL: bm.setText("BWTimer Serial"); break;
			case BWTIMER_NETWORK: bm.setText("BWTimer Network"); break;
			case PROTIMER_NETWORK: bm.setText("ProTimer Network"); break;
		}
	}

	modeGroup.setSelected(Mode.OFF);
	return timerMenu;
}
 
開發者ID:drytoastman,項目名稱:scorekeeperfrontend,代碼行數:28,代碼來源:TimeEntry.java

示例2: populateSearchers

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
private void populateSearchers() {
  final JMenu searchersMenu = this.searchersMenu;
  searchersMenu.removeAll();
  final ToolsSettings settings = ToolsSettings.getInstance();
  final Collection<SearchEngine> searchEngines = settings.getSearchEngines();
  final SearchEngine selectedEngine = settings.getSelectedSearchEngine();
  if (searchEngines != null) {
    for (final SearchEngine se : searchEngines) {
      final SearchEngine finalSe = se;
      final JRadioButtonMenuItem item = new JRadioButtonMenuItem();
      item.setAction(new AbstractAction() {
        private static final long serialVersionUID = -3263394523150719487L;

        public void actionPerformed(final ActionEvent e) {
          settings.setSelectedSearchEngine(finalSe);
          settings.save();
          ComponentSource.this.updateSearchButtonTooltip();
        }
      });
      item.setSelected(se == selectedEngine);
      item.setText(se.getName());
      item.setToolTipText(se.getDescription());
      searchersMenu.add(item);
    }
  }
}
 
開發者ID:lobobrowser,項目名稱:LoboBrowser,代碼行數:27,代碼來源:ComponentSource.java

示例3: checkProjectNames

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
private void checkProjectNames() {
    for(Component componentIter : subMenu.getMenuComponents()) {
        if(componentIter instanceof JRadioButtonMenuItem) {
            JRadioButtonMenuItem menuItem = (JRadioButtonMenuItem) componentIter;
            Project projectIter = getItemProject(menuItem);
            if(projectIter != null && !ProjectUtils.getInformation(projectIter).getDisplayName().equals(menuItem.getText())) {
                menuItem.setText(ProjectUtils.getInformation(projectIter).getDisplayName());
            }
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:SetMainProject.java

示例4: createNameListener

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
/** creates new PropertyChangeListener that listens for "name" property... */

    // NOI18N
    private PropertyChangeListener createNameListener(final JRadioButtonMenuItem item) {
        return new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent ev) {
                    if (ev.getPropertyName().equals("name")) {
                        item.setText((String) ev.getNewValue());
                    }
                }
            };
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:WorkspaceSwitchAction.java

示例5: createLookAndFeelItem

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
protected JRadioButtonMenuItem createLookAndFeelItem(String lafName, String lafClassName) {
    JRadioButtonMenuItem lafItem = new LuckRadioButtonMenuItem();

    lafItem.setSelected(lafClassName.equals(lookAndFeel));
    lafItem.setHideActionText(true);
    lafItem.setAction(getAction("setLookAndFeel"));
    lafItem.setText(lafName);
    lafItem.setActionCommand(lafClassName);
    lookAndFeelRadioGroup.add(lafItem);
    
    return lafItem;
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:13,代碼來源:SwingSet3.java

示例6: createLookAndFeelItem

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
protected JRadioButtonMenuItem createLookAndFeelItem(String lafName, String lafClassName) {
    JRadioButtonMenuItem lafItem = new JRadioButtonMenuItem();

    lafItem.setSelected(lafClassName.equals(lookAndFeel));
    lafItem.setHideActionText(true);
    lafItem.setAction(getAction("setLookAndFeel"));
    lafItem.setText(lafName);
    lafItem.setActionCommand(lafClassName);
    lookAndFeelRadioGroup.add(lafItem);
    
    return lafItem;
}
 
開發者ID:JackJiang2011,項目名稱:beautyeye,代碼行數:13,代碼來源:SwingSet3.java

示例7: setText

import javax.swing.JRadioButtonMenuItem; //導入方法依賴的package包/類
public void setText(String value) {
	text = value;
	for (JRadioButtonMenuItem menuItem : menuItems.values()) {
		menuItem.setText(text);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:7,代碼來源:WindowMenuItemManager.java


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