本文整理了Java中javax.swing.JComboBox.registerKeyboardAction()
方法的一些代码示例,展示了JComboBox.registerKeyboardAction()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComboBox.registerKeyboardAction()
方法的具体详情如下:
包路径:javax.swing.JComboBox
类名称:JComboBox
方法名:registerKeyboardAction
暂无
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf
comboBox.registerKeyboardAction(downAction,
KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(downAction,
KeyStroke.getKeyStroke("KP_DOWN"),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(altAction,
KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, InputEvent.ALT_MASK),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(altAction,
KeyStroke.getKeyStroke("alt KP_DOWN"),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(altAction,
KeyStroke.getKeyStroke(KeyEvent.VK_UP, InputEvent.ALT_MASK),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(altAction,
KeyStroke.getKeyStroke("alt KP_UP"),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(upAction,
KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0),
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
comboBox.registerKeyboardAction(upAction,
代码示例来源:origin: org.gdl-lang.gdl-tools/openehr-utils-gui-swing
private void init(Dimension size) {
this.setSize(size);
ScreenUtil.centerComponentOnScreen(this, this.getOwner());
this.setResizable(false);
this.addWindowListener(getCancelChangesAction());
this.setContentPane(getMainPanel());
/* Enter KeyStroke */
KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, true);
getComboBox().registerKeyboardAction(getAcceptChangesAction(), enter, JComponent.WHEN_IN_FOCUSED_WINDOW);
KeyStroke esc = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, true);
getComboBox().registerKeyboardAction(getCancelChangesAction(), esc, JComponent.WHEN_IN_FOCUSED_WINDOW);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv
nameComboBox.registerKeyboardAction(new ActionListener() {
public void actionPerformed(ActionEvent e) {
nameComboBox.requestFocus();
内容来源于网络,如有侵权,请联系作者删除!