本文整理了Java中javax.swing.JMenuItem.getAccessibleContext()
方法的一些代码示例,展示了JMenuItem.getAccessibleContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JMenuItem.getAccessibleContext()
方法的具体详情如下:
包路径:javax.swing.JMenuItem
类名称:JMenuItem
方法名:getAccessibleContext
暂无
代码示例来源:origin: apache/geode
private void createMenu() {
JMenuBar menuBar = new JMenuBar();
JMenu sequenceMenu = new JMenu("Sequence");
sequenceMenu.setMnemonic(KeyEvent.VK_S);
sequenceMenu.getAccessibleContext()
.setAccessibleDescription("The only menu in this program that has menu items");
menuBar.add(sequenceMenu);
JMenuItem selectGraphs = new JMenuItem("Choose Graphs", KeyEvent.VK_G);
selectGraphs.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_G, ActionEvent.ALT_MASK));
selectGraphs.getAccessibleContext().setAccessibleDescription("Select what graphs to display");
selectGraphs.setActionCommand("selectgraphs");
selectGraphs.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
showGraphSelector();
}
});
sequenceMenu.add(selectGraphs);
frame.setJMenuBar(menuBar);
}
代码示例来源:origin: fossasia/neurolab-desktop
menuOpenItem.getAccessibleContext().setAccessibleDescription("Open EEG files");
menuOpenItem.addActionListener(new ActionListener()
menuSaveItem.getAccessibleContext().setAccessibleDescription("Save CSV file...");
menuSaveItem.addActionListener(new ActionListener()
代码示例来源:origin: com.fifesoft.rtext/fife.common
private static void configureMenuItem(JMenuItem item, String desc) {
// Since these menu items are often configured with Actions, we must
// explicitly set the tool tip text to null
item.setToolTipText(null);
item.getAccessibleContext().setAccessibleDescription(desc);
}
代码示例来源:origin: io.snappydata/gemfire-hydra-tests
private void createMenu() {
JMenuBar menuBar = new JMenuBar();
JMenu sequenceMenu = new JMenu("Sequence");
sequenceMenu.setMnemonic(KeyEvent.VK_S);
sequenceMenu.getAccessibleContext().setAccessibleDescription(
"The only menu in this program that has menu items");
menuBar.add(sequenceMenu);
JMenuItem selectGraphs = new JMenuItem("Choose Graphs",
KeyEvent.VK_G);
selectGraphs.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_G, ActionEvent.ALT_MASK));
selectGraphs.getAccessibleContext().setAccessibleDescription(
"Select what graphs to display");
selectGraphs.setActionCommand("selectgraphs");
selectGraphs.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
showGraphSelector();
}
});
sequenceMenu.add(selectGraphs);
frame.setJMenuBar(menuBar);
}
代码示例来源:origin: org.jfree/com.springsource.org.jfree
/**
* Constructs a new panel.
*/
public SystemPropertiesPanel() {
final String baseName = "org.jfree.ui.about.resources.AboutResources";
final ResourceBundle resources = ResourceBundle.getBundle(baseName);
setLayout(new BorderLayout());
this.table = SystemProperties.createSystemPropertiesTable();
add(new JScrollPane(this.table));
// Add a popup menu to copy to the clipboard...
this.copyPopupMenu = new JPopupMenu();
final String label = resources.getString("system-properties-panel.popup-menu.copy");
final KeyStroke accelerator = (KeyStroke)
resources.getObject("system-properties-panel.popup-menu.copy.accelerator");
this.copyMenuItem = new JMenuItem(label);
this.copyMenuItem.setAccelerator(accelerator);
this.copyMenuItem.getAccessibleContext().setAccessibleDescription(label);
this.copyMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
copySystemPropertiesToClipboard();
}
});
this.copyPopupMenu.add(this.copyMenuItem);
// add popup Listener to the table
this.copyPopupListener = new PopupListener();
this.table.addMouseListener(this.copyPopupListener);
}
代码示例来源:origin: GrammarViz2/grammarviz2_src
openFileItem.getAccessibleContext().setAccessibleDescription("Open a data file");
openFileItem.setActionCommand(SELECT_FILE);
openFileItem.addActionListener(this);
exitItem.getAccessibleContext().setAccessibleDescription("Exit from here");
exitItem.addActionListener(this);
fileMenu.add(exitItem);
optionsItem.setActionCommand(OPTIONS_MENU_ITEM);
optionsItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK));
optionsItem.getAccessibleContext().setAccessibleDescription("Options");
optionsItem.addActionListener(this);
settingsMenu.add(optionsItem);
helpItem.getAccessibleContext().setAccessibleDescription("Get some help here.");
exitItem.addActionListener(controller);
helpMenu.add(helpItem);
aboutItem.getAccessibleContext().setAccessibleDescription("About the app.");
aboutItem.setActionCommand(ABOUT_MENU_ITEM);
aboutItem.addActionListener(this);
代码示例来源:origin: org.jfree/jcommon
/**
* Constructs a new panel.
*/
public SystemPropertiesPanel() {
final String baseName = "org.jfree.ui.about.resources.AboutResources";
final ResourceBundle resources = ResourceBundleWrapper.getBundle(
baseName);
setLayout(new BorderLayout());
this.table = SystemProperties.createSystemPropertiesTable();
add(new JScrollPane(this.table));
// Add a popup menu to copy to the clipboard...
this.copyPopupMenu = new JPopupMenu();
final String label = resources.getString(
"system-properties-panel.popup-menu.copy");
final KeyStroke accelerator = (KeyStroke) resources.getObject(
"system-properties-panel.popup-menu.copy.accelerator");
this.copyMenuItem = new JMenuItem(label);
this.copyMenuItem.setAccelerator(accelerator);
this.copyMenuItem.getAccessibleContext().setAccessibleDescription(
label);
this.copyMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
copySystemPropertiesToClipboard();
}
});
this.copyPopupMenu.add(this.copyMenuItem);
// add popup Listener to the table
this.copyPopupListener = new PopupListener();
this.table.addMouseListener(this.copyPopupListener);
}
代码示例来源:origin: jfree/jcommon
/**
* Constructs a new panel.
*/
public SystemPropertiesPanel() {
final String baseName = "org.jfree.ui.about.resources.AboutResources";
final ResourceBundle resources = ResourceBundleWrapper.getBundle(
baseName);
setLayout(new BorderLayout());
this.table = SystemProperties.createSystemPropertiesTable();
add(new JScrollPane(this.table));
// Add a popup menu to copy to the clipboard...
this.copyPopupMenu = new JPopupMenu();
final String label = resources.getString(
"system-properties-panel.popup-menu.copy");
final KeyStroke accelerator = (KeyStroke) resources.getObject(
"system-properties-panel.popup-menu.copy.accelerator");
this.copyMenuItem = new JMenuItem(label);
this.copyMenuItem.setAccelerator(accelerator);
this.copyMenuItem.getAccessibleContext().setAccessibleDescription(
label);
this.copyMenuItem.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
copySystemPropertiesToClipboard();
}
});
this.copyPopupMenu.add(this.copyMenuItem);
// add popup Listener to the table
this.copyPopupListener = new PopupListener();
this.table.addMouseListener(this.copyPopupListener);
}
代码示例来源:origin: pentaho/pentaho-reporting
/**
* Constructs a new panel.
*/
public SystemPropertiesPanel() {
final ResourceBundleSupport bundleSupport =
new ResourceBundleSupport( Locale.getDefault(), SwingPreviewModule.BUNDLE_NAME, ObjectUtilities
.getClassLoader( SwingPreviewModule.class ) );
setLayout( new BorderLayout() );
this.table = SystemPropertiesPanel.createSystemPropertiesTable();
add( new JScrollPane( this.table ) );
// Add a popup menu to copy to the clipboard...
this.copyPopupMenu = new JPopupMenu();
final String label = bundleSupport.getString( "system-properties-panel.popup-menu.copy" );
final KeyStroke accelerator = bundleSupport.getKeyStroke( "system-properties-panel.popup-menu.copy.accelerator" );
final JMenuItem copyMenuItem = new JMenuItem( label );
copyMenuItem.setAccelerator( accelerator );
copyMenuItem.getAccessibleContext().setAccessibleDescription( label );
copyMenuItem.addActionListener( new CopyAction() );
this.copyPopupMenu.add( copyMenuItem );
// add popup Listener to the table
final PopupListener copyPopupListener = new PopupListener();
this.table.addMouseListener( copyPopupListener );
}
代码示例来源:origin: stackoverflow.com
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
filemenu.add(menuItem);
menuItem = new JMenuItem("Open File...",KeyEvent.VK_O);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
filemenu.add(menuItem);
menuItem = new JMenuItem("Close",KeyEvent.VK_C);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
filemenu.add(menuItem);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
editmenu.add(menuItem);
menuItem = new JMenuItem("Redo",KeyEvent.VK_R);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
editmenu.add(menuItem);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
editsubmenu.add(menuItem);
menuItem.getAccessibleContext().setAccessibleDescription("");
menuItem.addActionListener(this);
editsubmenu.add(menuItem);
menuItem.getAccessibleContext().setAccessibleDescription("");
代码示例来源:origin: stackoverflow.com
menuItem = new JMenuItem("A text-only menu item", KeyEvent.VK_T);
menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, ActionEvent.ALT_MASK));
menuItem.getAccessibleContext().setAccessibleDescription("This doesn't really do anything");
menu.add(menuItem);
menuItem = new JMenuItem("Both text and icon", errorIcon);
代码示例来源:origin: org.ostermiller/utils
);
JMenuItem prefsMenuItem = new JMenuItem("Preferences...", KeyEvent.VK_P);
prefsMenuItem.getAccessibleContext().setAccessibleDescription(
"Set password length and content."
);
代码示例来源:origin: stackoverflow.com
changed_Name.setMnemonic(KeyEvent.VK_C);
changed_Name.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1, KeyEvent.ALT_MASK));
changed_Name.getAccessibleContext().setAccessibleDescription("This Will Allow a Name Change");
changed_Name.addActionListener(menuHandler);
menu.add(changed_Name);
menuItem.getAccessibleContext().setAccessibleDescription("Get Help or View Software documents");
menuItem.addActionListener(menuHandler);
menu.add(menuItem);
代码示例来源:origin: stackoverflow.com
menuItem.getAccessibleContext().setAccessibleDescription("This doesn't really do anything");
menu.add(menuItem);
ImageIcon icon = createImageIcon("middle.gif");
代码示例来源:origin: stackoverflow.com
menuItem.getAccessibleContext().setAccessibleDescription(
"This doesn't really do anything");
menu.add(menuItem);
代码示例来源:origin: com.fifesoft.rtext/fife.common
@Override
public void stateChanged(ChangeEvent e) {
if (statusBar==null) {
return;
}
String msg = statusBar.getDefaultStatusMessage();
MenuElement[] path = MenuSelectionManager.
defaultManager().getSelectedPath();
if (path.length>0) {
Component c = path[path.length-1].getComponent();
if (c instanceof JMenuItem) {
JMenuItem item = (JMenuItem)c;
Action a = item.getAction();
if (a!=null) {
msg = (String)a.getValue(
Action.SHORT_DESCRIPTION);
}
else {
String text = item.getAccessibleContext().
getAccessibleDescription();
if (text!=null) {
msg = text;
}
}
}
}
statusBar.setStatusMessage(msg);
}
}
内容来源于网络,如有侵权,请联系作者删除!