public class ComponentInputMap extends InputMap
ComponentInputMap
は、特定のJComponent
に関連付けられているInputMap
です。 ComponentInputMap
が変わると、コンポーネントが自動的に通知されます。 ComponentInputMap
はWHEN_IN_FOCUSED_WINDOW
バインディングに使用されます。 コンストラクタ | 説明 |
---|---|
ComponentInputMap(JComponent component) |
指定されたコンポーネントに関連付けられた
ComponentInputMap を生成します。 |
修飾子と型 | メソッド | 説明 |
---|---|---|
void |
clear() |
このオブジェクトからすべてのマッピングを削除します。
|
JComponent |
getComponent() |
InputMap が生成されたコンポーネントを返します。 |
void |
put(KeyStroke keyStroke, Object actionMapKey) |
actionMapKey にkeyStroke のバインディングを追加します。 |
void |
remove(KeyStroke key) |
このオブジェクトから
key のバインドを削除します。 |
void |
setParent(InputMap map) |
親を設定します。親は、この
ComponentInputMap と同じコンポーネントに関連付けられたComponentInputMap である必要があります。 |
public ComponentInputMap(JComponent component)
ComponentInputMap
を生成します。component
- null以外JComponent
IllegalArgumentException
- component
がnullである場合public void setParent(InputMap map)
ComponentInputMap
と同じコンポーネントに関連付けられたComponentInputMap
である必要があります。setParent
、クラスInputMap
map
- ComponentInputMap
IllegalArgumentException
- map
がComponentInputMap
でない場合、または同じコンポーネントに関連付けられていない場合public JComponent getComponent()
InputMap
が生成されたコンポーネントを返します。public void put(KeyStroke keyStroke, Object actionMapKey)
actionMapKey
にkeyStroke
のバインディングを追加します。 actionMapKey
がnullの場合、keyStroke
の現在のバインディングを削除します。 バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。