| 
JavaTM 2 Platform Standard Ed. 6  | 
|||||||||
| 上一个 下一个 | 框架 无框架 | |||||||||
| 使用 KeyStroke 的软件包 | |
|---|---|
| javax.swing | 提供一组“轻量级”(全部是 Java 语言)组件,尽量让这些组件在所有平台上的工作方式都相同。 | 
| javax.swing.plaf.basic | 提供了根据基本外观构建的用户界面对象。 | 
| javax.swing.text | 提供类 HTMLEditorKit 和创建 HTML 文本编辑器的支持类。  | 
| javax.swing 中 KeyStroke 的使用 | 
|---|
| 返回 KeyStroke 的 javax.swing 中的方法 | |
|---|---|
 KeyStroke[] | 
InputMap.allKeys()
返回在此 InputMap 及其父级中定义的 KeyStroke 组成的数组。 | 
 KeyStroke | 
JMenuItem.getAccelerator()
返回作为菜单项的加速器的 KeyStroke。 | 
static KeyStroke | 
KeyStroke.getKeyStroke(char keyChar)
返回 KeyStroke 的共享实例,前者表示指定字符的 KEY_TYPED 事件。 | 
static KeyStroke | 
KeyStroke.getKeyStroke(Character keyChar,
int modifiers)
返回 KeyStroke 的一个共享实例,它表示指定 Character 对象和一组修饰符的 KEY_TYPED 事件。 | 
static KeyStroke | 
KeyStroke.getKeyStroke(char keyChar,
boolean onKeyRelease)
已过时。 使用 getKeyStroke(char)  | 
static KeyStroke | 
KeyStroke.getKeyStroke(int keyCode,
int modifiers)
在给出一个数字键代码和一组修饰符的情况下,返回 KeyStroke 的一个共享实例。  | 
static KeyStroke | 
KeyStroke.getKeyStroke(int keyCode,
int modifiers,
boolean onKeyRelease)
在给出一个数字键代码和一组修饰符的情况下,返回 KeyStroke 的一个共享实例,指定该键在按下或释放时是否为已激活。  | 
static KeyStroke | 
KeyStroke.getKeyStroke(String s)
分析字符串并返回 KeyStroke。 | 
static KeyStroke | 
KeyStroke.getKeyStrokeForEvent(KeyEvent anEvent)
返回一个 KeyStroke,它表示生成给定 KeyEvent 的快捷键事件。  | 
 KeyStroke[] | 
JComponent.getRegisteredKeyStrokes()
返回启动已注册动作的 KeyStrokes。 | 
 KeyStroke[] | 
InputMap.keys()
返回绑定在此 InputMap 中的 KeyStroke。 | 
| 参数类型为 KeyStroke 的 javax.swing 中的方法 | |
|---|---|
 Object | 
InputMap.get(KeyStroke keyStroke)
返回 keyStroke 的绑定,如果该绑定不是本地定义的,则将此消息传递给父 InputMap。 | 
 ActionListener | 
JComponent.getActionForKeyStroke(KeyStroke aKeyStroke)
返回执行针对给定键击而注册的操作的对象。  | 
 int | 
JComponent.getConditionForKeyStroke(KeyStroke aKeyStroke)
返回确定是否发生已注册动作以响应指定键击事件的条件。  | 
static boolean | 
SwingUtilities.notifyAction(Action action,
KeyStroke ks,
KeyEvent event,
Object sender,
int modifiers)
如果启用 action(且为非 null),则调用 action 上的 actionPerformed。 | 
protected  boolean | 
JTable.processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
 | 
protected  boolean | 
JMenuBar.processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
子类化以检查所有子菜单。  | 
protected  boolean | 
JComponent.processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
由于发生 KeyEvent e 而调用此方法处理 ks 的键绑定。 | 
 void | 
ComponentInputMap.put(KeyStroke keyStroke,
Object actionMapKey)
将一个 keyStroke 的绑定添加到 actionMapKey。 | 
 void | 
InputMap.put(KeyStroke keyStroke,
Object actionMapKey)
将 keyStroke 的一个绑定添加到 actionMapKey。 | 
 void | 
JComponent.registerKeyboardAction(ActionListener anAction,
KeyStroke aKeyStroke,
int aCondition)
此方法现在已过时,对于类似的操作,请结合使用 getActionMap() 和 getInputMap()。 | 
 void | 
JComponent.registerKeyboardAction(ActionListener anAction,
String aCommand,
KeyStroke aKeyStroke,
int aCondition)
此方法现在已过时,对于类似的操作,请结合使用 getActionMap() 和 getInputMap()。 | 
 void | 
ComponentInputMap.remove(KeyStroke key)
从此对象中移除 key 的绑定。 | 
 void | 
InputMap.remove(KeyStroke key)
从此 InputMap 中移除 key 的绑定。 | 
 void | 
JMenu.setAccelerator(KeyStroke keyStroke)
没有为 JMenu 定义 setAccelerator。 | 
 void | 
JMenuItem.setAccelerator(KeyStroke keyStroke)
设置修改键,它能直接调用菜单项的操作侦听器而不必显示菜单的层次结构。  | 
 void | 
JComponent.unregisterKeyboardAction(KeyStroke aKeyStroke)
此方法现在已过时。  | 
| javax.swing.plaf.basic 中 KeyStroke 的使用 | 
|---|
| 声明为 KeyStroke 的 javax.swing.plaf.basic 中的字段 | |
|---|---|
protected  KeyStroke | 
BasicDesktopPaneUI.closeKey
已过时。 从 1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.dividerResizeToggleKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.downKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicTabbedPaneUI.downKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicToolBarUI.downKey
已过时。 从 Java 2 平台 v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.endKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.homeKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.leftKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicTabbedPaneUI.leftKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicToolBarUI.leftKey
已过时。 从 Java 2 平台 v1.3 开始。  | 
protected  KeyStroke | 
BasicDesktopPaneUI.maximizeKey
已过时。 从 1.3 开始。  | 
protected  KeyStroke | 
BasicDesktopPaneUI.minimizeKey
已过时。 从 1.3 开始。  | 
protected  KeyStroke | 
BasicDesktopPaneUI.navigateKey
已过时。 从 1.3 开始。  | 
protected  KeyStroke | 
BasicDesktopPaneUI.navigateKey2
已过时。 从 1.3 开始。  | 
protected  KeyStroke | 
BasicInternalFrameUI.openMenuKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.rightKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicTabbedPaneUI.rightKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicToolBarUI.rightKey
已过时。 从 Java 2 平台 v1.3 开始。  | 
protected  KeyStroke | 
BasicSplitPaneUI.upKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicTabbedPaneUI.upKey
已过时。 从 Java 2 platform v1.3 开始。  | 
protected  KeyStroke | 
BasicToolBarUI.upKey
已过时。 从 Java 2 平台 v1.3 开始。  | 
| javax.swing.text 中 KeyStroke 的使用 | 
|---|
| 声明为 KeyStroke 的 javax.swing.text 中的字段 | |
|---|---|
 KeyStroke | 
JTextComponent.KeyBinding.key
键。  | 
| 返回 KeyStroke 的 javax.swing.text 中的方法 | |
|---|---|
 KeyStroke[] | 
Keymap.getBoundKeyStrokes()
获取在此映射中绑定到其他操作的所有击键。  | 
 KeyStroke[] | 
Keymap.getKeyStrokesForAction(Action a)
获取将导致给定操作的击键。  | 
| 参数类型为 KeyStroke 的 javax.swing.text 中的方法 | |
|---|---|
 void | 
Keymap.addActionForKeyStroke(KeyStroke key,
Action a)
向 keymap 添加绑定。  | 
 Action | 
Keymap.getAction(KeyStroke key)
获取适合于给定符号事件序列的操作。  | 
 boolean | 
Keymap.isLocallyDefined(KeyStroke key)
确定是否本地定义给定的键序列。  | 
 void | 
Keymap.removeKeyStrokeBinding(KeyStroke keys)
从 keymap 移除绑定。  | 
| 参数类型为 KeyStroke 的 javax.swing.text 中的构造方法 | |
|---|---|
JTextComponent.KeyBinding(KeyStroke key,
String actionName)
创建新的键绑定。  | 
|
  | 
JavaTM 2 Platform Standard Ed. 6  | 
|||||||||
| 上一个 下一个 | 框架 无框架 | |||||||||
版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only。