本文整理了Java中javax.swing.JTabbedPane.getInputMap()
方法的一些代码示例,展示了JTabbedPane.getInputMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTabbedPane.getInputMap()
方法的具体详情如下:
包路径:javax.swing.JTabbedPane
类名称:JTabbedPane
方法名:getInputMap
暂无
代码示例来源:origin: ron190/jsql-injection
/**
* Add action to a single tabbedpane (ctrl-tab, ctrl-shift-tab).
*/
public static void addShortcut(JTabbedPane tabbedPane) {
KeyStroke ctrlTab = KeyStroke.getKeyStroke("ctrl TAB");
KeyStroke ctrlShiftTab = KeyStroke.getKeyStroke("ctrl shift TAB");
// Remove ctrl-tab from normal focus traversal
Set<AWTKeyStroke> forwardKeys = new HashSet<>(tabbedPane.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
forwardKeys.remove(ctrlTab);
tabbedPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forwardKeys);
// Remove ctrl-shift-tab from normal focus traversal
Set<AWTKeyStroke> backwardKeys = new HashSet<>(tabbedPane.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
backwardKeys.remove(ctrlShiftTab);
tabbedPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, backwardKeys);
// Add keys to the tab's input map
InputMap inputMap = tabbedPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(ctrlTab, "navigateNext");
inputMap.put(ctrlShiftTab, "navigatePrevious");
}
代码示例来源:origin: stackoverflow.com
JTabbedPane jTabbedPane = new JTabbedPane();
KeyStroke ctrlTab = KeyStroke.getKeyStroke("ctrl PAGE_DOWN");
KeyStroke ctrlShiftTab = KeyStroke.getKeyStroke("ctrl PAGE_UP");
InputMap inputMap = jTabbedPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(ctrlTab, "none");
inputMap.put(ctrlShiftTab, "none");
代码示例来源:origin: Audiveris/audiveris
/**
* Bind a few keyboard events to actions among assemblies.
*/
private void bindKeys ()
{
final InputMap inputMap = stubsPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
final ActionMap actionMap = stubsPane.getActionMap();
inputMap.put(KeyStroke.getKeyStroke("PAGE_UP"), "PageUpAction");
actionMap.put("PageUpAction", new PageUpAction());
inputMap.put(KeyStroke.getKeyStroke("PAGE_DOWN"), "PageDownAction");
actionMap.put("PageDownAction", new PageDownAction());
inputMap.put(KeyStroke.getKeyStroke("control HOME"), "CtrlHomeAction");
actionMap.put("CtrlHomeAction", new CtrlHomeAction());
inputMap.put(KeyStroke.getKeyStroke("control END"), "CtrlEndAction");
actionMap.put("CtrlEndAction", new CtrlEndAction());
}
代码示例来源:origin: org.appdapter/org.appdapter.lib.gui
private static void setupTabTraversalKeys(JTabbedPane tabbedPane) {
KeyStroke ctrlTab = KeyStroke.getKeyStroke("ctrl TAB");
KeyStroke ctrlShiftTab = KeyStroke.getKeyStroke("ctrl shift TAB");
// Remove ctrl-tab from normal focus traversal
Set<AWTKeyStroke> forwardKeys = new HashSet<AWTKeyStroke>(tabbedPane.getFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS));
forwardKeys.remove(ctrlTab);
tabbedPane.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, forwardKeys);
// Remove ctrl-shift-tab from normal focus traversal
Set<AWTKeyStroke> backwardKeys = new HashSet<AWTKeyStroke>(tabbedPane.getFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS));
backwardKeys.remove(ctrlShiftTab);
tabbedPane.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS, backwardKeys);
// Add keys to the tab's input map
InputMap inputMap = tabbedPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
inputMap.put(ctrlTab, "navigateNext");
inputMap.put(ctrlShiftTab, "navigatePrevious");
}
代码示例来源:origin: stackoverflow.com
tp.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ks, "NextTab");
代码示例来源:origin: otros-systems/otroslogviewer
jTabbedPane.getInputMap(JComponent.WHEN_FOCUSED).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "start-editing");
jTabbedPane.getActionMap().put("start-editing", new AbstractAction() {
@Override
代码示例来源:origin: mguessan/davmail
tabbedPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("F1"),
"help");
tabbedPane.getActionMap().put("help", new AbstractAction() {
内容来源于网络,如有侵权,请联系作者删除!