本文整理了Java中javax.swing.JMenuItem.setText()
方法的一些代码示例,展示了JMenuItem.setText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.setText()
方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:setText
暂无
代码示例来源:origin: stanfordnlp/CoreNLP
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
loadDataItem = new javax.swing.JMenuItem();
loadParserItem = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
exitItem = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
untokEngItem = new javax.swing.JCheckBoxMenuItem();
loadDataItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O, java.awt.event.InputEvent.ALT_MASK));
loadDataItem.setMnemonic('o');
loadDataItem.setText("Load File");
loadDataItem.setToolTipText("Load a data file.");
loadDataItem.addActionListener(this::loadDataItemActionPerformed);
loadParserItem.setText("Load Parser");
loadParserItem.addActionListener(this::loadParserItemActionPerformed);
exitItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X, java.awt.event.InputEvent.ALT_MASK));
exitItem.setMnemonic('x');
exitItem.setText("Exit");
exitItem.setToolTipText("Exits the program.");
exitItem.addActionListener(this::exitItemActionPerformed);
代码示例来源:origin: marytts/marytts
jMenuBar_AdminWindow = new javax.swing.JMenuBar();
jMenu_File = new javax.swing.JMenu();
jMenuItem_Open = new javax.swing.JMenuItem();
jMenuItem_ImportText = new javax.swing.JMenuItem();
jSeparator_File = new javax.swing.JSeparator();
jMenuItem_Exit = new javax.swing.JMenuItem();
jMenu_Tools = new javax.swing.JMenu();
jMenuItem_Options = new javax.swing.JMenuItem();
jMenuItem_Open.setText("Open Voice...");
jMenuItem_Open.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem_ImportText.setText("Import text file...");
jMenuItem_ImportText.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem_Exit.setText("Exit");
jMenuItem_Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem_Options.setText("Options...");
jMenuItem_Options.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenu_About.setText("About Redstart");
jMenu_About.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: marytts/marytts
menuBar1 = new javax.swing.JMenuBar();
menuTools1 = new javax.swing.JMenu();
miProxy1 = new javax.swing.JMenuItem();
miProxy1.setText("Proxy settings...");
miProxy1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: marytts/marytts
menuBar1 = new javax.swing.JMenuBar();
menuTools1 = new javax.swing.JMenu();
miProxy1 = new javax.swing.JMenuItem();
miProxy1.setText("Proxy settings...");
miProxy1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: ron190/jsql-injection
public JPopupMenuTable(JTable tableValues, Action actionShowSearchTable) {
this(tableValues);
this.addSeparator();
JMenuItem search = new JMenuItem();
search.setAction(actionShowSearchTable);
search.setText("Search...");
search.setMnemonic('S');
search.setIcon(HelperUi.ICON_EMPTY);
search.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK));
this.add(search);
}
代码示例来源:origin: ron190/jsql-injection
menus.put("Hex(zipped)", new JMenu("Hex(zipped)"));
JMenuItem menuEncodeHtmlDecimal = new JMenuItem("Encode to Html (decimal)");
menuHtml.add(menuEncodeHtmlDecimal);
menuEncodeHtmlDecimal.addActionListener(this.actionCoder);
JMenuItem menuEncode = new JMenuItem("Encode to "+ entryMap.getKey());
menuEncode.addActionListener(this.actionCoder);
menuEncode.addChangeListener(new ChangeMenuListener("Encode to "+ entryMap.getKey()));
JMenuItem menuDecode = new JMenuItem("Decode from "+ entryMap.getKey());
menuDecode.addActionListener(this.actionCoder);
menuDecode.addChangeListener(new ChangeMenuListener("Decode from "+ entryMap.getKey()));
comboMenubar.setBorder(null);
this.menuMethod.setText("Encode to Base64");
代码示例来源:origin: ron190/jsql-injection
/**
* Create popup menu for this component.
* @param component The component receiving the menu
*/
public JPopupMenuText(JTextComponent component) {
super(component);
if (component.isEditable()) {
JMenuItem cutItem = new JMenuItem();
cutItem.setIcon(HelperUi.ICON_EMPTY);
cutItem.setAction(component.getActionMap().get(DefaultEditorKit.cutAction));
cutItem.setText("Cut");
cutItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.CTRL_MASK));
cutItem.setMnemonic('t');
JMenuItem pasteItem = new JMenuItem();
pasteItem.setIcon(HelperUi.ICON_EMPTY);
pasteItem.setAction(component.getActionMap().get(DefaultEditorKit.pasteAction));
pasteItem.setText("Paste");
pasteItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK));
pasteItem.setMnemonic('P');
// Before Copy menu
this.add(cutItem, 0);
// After Copy menu
this.add(pasteItem, 2);
}
}
代码示例来源:origin: pentaho/mondrian
newSchemaMenuItem2.setText(
getResourceConverter().getString(
"workbench.menu.newSchema", "Schema"));
newQueryMenuItem2.setText(
getResourceConverter().getString(
"workbench.menu.newQuery", "MDX Query"));
newJDBCExplorerMenuItem2.setText(
getResourceConverter().getString(
"workbench.menu.newJDBC", "JDBC Explorer"));
newSchemaMenuItem.setText(
getResourceConverter().getString(
"workbench.menu.newSchema", "Schema"));
newQueryMenuItem.setText(
getResourceConverter().getString(
"workbench.menu.newQuery", "MDX Query"));
newJDBCExplorerMenuItem.setText(
getResourceConverter().getString(
"workbench.menu.newJDBC", "JDBC Explorer"));
openMenuItem.setText(
getResourceConverter().getString(
"workbench.menu.open", "Open"));
saveMenuItem.setText(
代码示例来源:origin: ron190/jsql-injection
JMenuItem copyItem = new JMenuItem();
copyItem.setAction(new ActionCopy());
copyItem.setText(I18n.valueByKey("CONTEXT_MENU_COPY"));
I18nView.addComponentForKey("CONTEXT_MENU_COPY", copyItem);
copyItem.setMnemonic('C');
JMenuItem selectAllItem = new JMenuItem();
selectAllItem.setAction(new ActionSelectAll());
selectAllItem.setText(I18n.valueByKey("CONTEXT_MENU_SELECT_ALL"));
I18nView.addComponentForKey("CONTEXT_MENU_SELECT_ALL", selectAllItem);
selectAllItem.setMnemonic('A');
代码示例来源:origin: winder/Universal-G-Code-Sender
grblConnectionSettingsMenuItem = new javax.swing.JMenuItem();
firmwareSettingsMenu = new javax.swing.JMenu();
grblFirmwareSettingsMenuItem = new javax.swing.JMenuItem();
gcodeProcessorSettings = new javax.swing.JMenuItem();
pendantMenu = new com.willwinder.universalgcodesender.uielements.components.PendantMenu(backend);
grblConnectionSettingsMenuItem.setText("Sender Settings");
grblConnectionSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
settingsMenu.add(grblConnectionSettingsMenuItem);
gcodeProcessorSettings.setText("Gcode Processor Settings");
gcodeProcessorSettings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
grblFirmwareSettingsMenuItem.setText("GRBL");
grblFirmwareSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
代码示例来源:origin: ron190/jsql-injection
this.component = component;
JMenuItem copyItem = new JMenuItem();
copyItem.setAction(component.getActionMap().get(DefaultEditorKit.copyAction));
copyItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
copyItem.setMnemonic('C');
copyItem.setText(I18n.valueByKey("CONTEXT_MENU_COPY"));
I18nView.addComponentForKey("CONTEXT_MENU_COPY", copyItem);
copyItem.setIcon(HelperUi.ICON_EMPTY);
this.setLightWeightPopupEnabled(false);
JMenuItem selectAllItem = new JMenuItem();
selectAllItem.setIcon(HelperUi.ICON_EMPTY);
selectAllItem.setAction(component.getActionMap().get(DefaultEditorKit.selectAllAction));
selectAllItem.setText(I18n.valueByKey("CONTEXT_MENU_SELECT_ALL"));
I18nView.addComponentForKey("CONTEXT_MENU_SELECT_ALL", selectAllItem);
selectAllItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
|| component instanceof JTextPanePlaceholderConsole
) {
JMenuItem clearItem = new JMenuItem();
clearItem.setIcon(HelperUi.ICON_EMPTY);
clearItem.setAction(new AbstractAction() {
clearItem.setText(I18n.valueByKey("CONTEXT_MENU_CLEAR"));
I18nView.addComponentForKey("CONTEXT_MENU_CLEAR", clearItem);
clearItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, ActionEvent.CTRL_MASK));
代码示例来源:origin: ron190/jsql-injection
JMenuItem itemCopyUrl = new JMenuItem(I18n.valueByKey("CONTEXT_MENU_COPY_PAGE_URL"));
I18nView.addComponentForKey("CONTEXT_MENU_COPY_PAGE_URL", itemCopyUrl);
itemCopyUrl.setIcon(HelperUi.ICON_EMPTY);
JMenuItem itemCopy = new JMenuItem();
itemCopy.setAction(browser.getActionMap().get(DefaultEditorKit.copyAction));
itemCopy.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK));
itemCopy.setMnemonic('C');
itemCopy.setText(I18n.valueByKey("CONTEXT_MENU_COPY"));
I18nView.addComponentForKey("CONTEXT_MENU_COPY", itemCopy);
itemCopy.setIcon(HelperUi.ICON_EMPTY);
JMenuItem itemSelectAll = new JMenuItem();
itemSelectAll.setIcon(HelperUi.ICON_EMPTY);
itemSelectAll.setAction(browser.getActionMap().get(DefaultEditorKit.selectAllAction));
itemSelectAll.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.CTRL_MASK));
itemSelectAll.setText(I18n.valueByKey("CONTEXT_MENU_SELECT_ALL"));
I18nView.addComponentForKey("CONTEXT_MENU_SELECT_ALL", itemSelectAll);
itemSelectAll.setMnemonic('A');
代码示例来源:origin: pentaho/mondrian
new javax.swing.JMenuItem();
jdbcMenuItem.setText(
getResourceConverter().getFormattedString(
"workbench.new.JDBCExplorer.menuitem",
代码示例来源:origin: pentaho/mondrian
final javax.swing.JMenuItem queryMenuItem = new javax.swing.JMenuItem();
queryMenuItem.setText(
getResourceConverter().getFormattedString(
"workbench.new.MDXQuery.menuitem",
代码示例来源:origin: pentaho/mondrian
new javax.swing.JMenuItem();
schemaMenuItem.setText(windowMenuMapIndex++ + " " + file.getName());
schemaMenuItem.addActionListener(
new ActionListener() {
代码示例来源:origin: winder/Universal-G-Code-Sender
stopPendantServerButton = new javax.swing.JMenuItem();
jMenuItem1.setText("jMenuItem1");
jMenuItem3.setText("jMenuItem3");
jMenuItem4.setText("jMenuItem4");
grblConnectionSettingsMenuItem.setText("Sender Settings");
grblConnectionSettingsMenuItem.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
settingsMenu.add(grblConnectionSettingsMenuItem);
firmwareSettings.setText("Firmware Settings");
settingsMenu.add(firmwareSettings);
gcodeProcessorSettings.setText("Gcode Processor Settings");
gcodeProcessorSettings.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
startPendantServerButton.setText("Start...");
startPendantServerButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
stopPendantServerButton.setText("Stop...");
stopPendantServerButton.setEnabled(false);
stopPendantServerButton.addActionListener(new java.awt.event.ActionListener() {
代码示例来源:origin: robo-code/robocode
private JMenuItem getBattleTakeScreenshotMenuItem() {
if (battleTakeScreenshotMenuItem == null) {
battleTakeScreenshotMenuItem = new JMenuItem();
battleTakeScreenshotMenuItem.setText("Take Screenshot");
battleTakeScreenshotMenuItem.setMnemonic('T');
battleTakeScreenshotMenuItem.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_T, MENU_SHORTCUT_KEY_MASK, false));
battleTakeScreenshotMenuItem.addActionListener(eventHandler);
}
return battleTakeScreenshotMenuItem;
}
代码示例来源:origin: robo-code/robocode
private JMenuItem getHelpJavaDocumentationMenuItem() {
if (helpJavaDocumentationMenuItem == null) {
helpJavaDocumentationMenuItem = new JMenuItem();
helpJavaDocumentationMenuItem.setText("Java API documentation");
helpJavaDocumentationMenuItem.setMnemonic('J');
helpJavaDocumentationMenuItem.addActionListener(eventHandler);
}
return helpJavaDocumentationMenuItem;
}
代码示例来源:origin: robo-code/robocode
private JMenuItem getCompilerOptionsPreferencesMenuItem() {
if (compilerOptionsPreferencesMenuItem == null) {
compilerOptionsPreferencesMenuItem = new JMenuItem();
compilerOptionsPreferencesMenuItem.setText("Preferences");
compilerOptionsPreferencesMenuItem.setMnemonic('P');
compilerOptionsPreferencesMenuItem.addActionListener(eventHandler);
}
return compilerOptionsPreferencesMenuItem;
}
代码示例来源:origin: robo-code/robocode
private JMenuItem getFileNewJavaFileMenuItem() {
if (fileNewJavaFileMenuItem == null) {
fileNewJavaFileMenuItem = new JMenuItem();
fileNewJavaFileMenuItem.setText("Java File");
fileNewJavaFileMenuItem.setMnemonic('J');
fileNewJavaFileMenuItem.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_N, MENU_SHORTCUT_KEY_MASK | Event.SHIFT_MASK));
fileNewJavaFileMenuItem.addActionListener(eventHandler);
}
return fileNewJavaFileMenuItem;
}
内容来源于网络,如有侵权,请联系作者删除!