JavaTM 2 Platform
Std. Ed. v1.3

javax.swing
クラス SwingUtilities

java.lang.Object
  |
  +--javax.swing.SwingUtilities
すべての実装インタフェース:
SwingConstants

public class SwingUtilities
extends Object
implements SwingConstants

Swing のユーティリティメソッドのコレクションです。


インタフェース javax.swing.SwingConstants から継承したフィールド
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
メソッドの概要
static Rectangle[] computeDifference(Rectangle rectA, Rectangle rectB)
          rectB とオーバーラップしない rectA 内の領域を表現する矩形の配列を返すために使われます。
static Rectangle computeIntersection(int x, int y, int width, int height, Rectangle dest)
          新しい矩形を割り当てずに、2 つの矩形の共通部分を計算するのに便利です。
static int computeStringWidth(FontMetrics fm, String str)
          指定されたメトリックス (サイズ) を持つフォントを使って文字列の幅を計算します。
static Rectangle computeUnion(int x, int y, int width, int height, Rectangle dest)
          新しい矩形 dest を割り当てずに、2 つの矩形の和集合を計算するのに便利です。
static MouseEvent convertMouseEvent(Component source, MouseEvent sourceEvent, Component destination)
          その x と y メンバが destination の座標体系に変換済みの場合を除いて、sourceEvent と同じような MouseEvent を返します。
static Point convertPoint(Component source, int x, int y, Component destination)
          source 座標体系の点 (x,y)destination 座標体系に変換します。
static Point convertPoint(Component source, Point aPoint, Component destination)
          source 座標体系の aPointdestination 座標体系に変換します。
static void convertPointFromScreen(Point p, Component c)
          ポイントを画面座標からコンポーネントの座標体系に変換します。
static void convertPointToScreen(Point p, Component c)
          ポイントをコンポーネントの座標体系から画面座標に変換します。
static Rectangle convertRectangle(Component source, Rectangle aRectangle, Component destination)
          source 座標体系の aRectangledestination 座標体系に変換します。
static Component findFocusOwner(Component c)
          フォーカスを持つ子コンポーネントがある場合はそれを返します。
static Accessible getAccessibleAt(Component c, Point p)
          ローカル座標の Point にユーザ補助機能を実装する子が保持されている場合はそれを返します。
static Accessible getAccessibleChild(Component c, int i)
          オブジェクトのユーザ補助機能を実装する n 番目の子を返します。
static int getAccessibleChildrenCount(Component c)
          オブジェクト内のユーザ補助機能を実装する子の数を返します。
static int getAccessibleIndexInParent(Component c)
          ユーザ補助機能を実装する親でのこのオブジェクトのインデックスを返します。
static AccessibleStateSet getAccessibleStateSet(Component c)
          このオブジェクトの状態を返します。
static Container getAncestorNamed(String name, Component comp)
          コンポーネント階層の上記の comp を検索するための簡易メソッドであり、見つかった name の最初のオブジェクトを返します。
static Container getAncestorOfClass(Class c, Component comp)
          コンポーネント階層の上位の comp を検索するための簡易メソッドであり、見つかった c クラスの最初のオブジェクトを返します。
static Component getDeepestComponentAt(Component parent, int x, int y)
          位置 xy を内包する parent を親として持つ、最下位の可視 Component を返します。
static Rectangle getLocalBounds(Component aComponent)
          aComponent コンポーネントの矩形 (0,0,bounds.width,bounds.height) を返します。
static Component getRoot(Component c)
          現在のコンポーネントツリーのルートコンポーネントを返します。
static JRootPane getRootPane(Component c)
          c が下位 JRootPane オブジェクトの場合は、その上位 JRootPane オブジェクトを返します。
static ActionMap getUIActionMap(JComponent component)
          UI が component に指定した ActionMap を返します。
static InputMap getUIInputMap(JComponent component, int condition)
          UI が componentcondition に指定した InputMap を返します。
static Window getWindowAncestor(Component c)
           
static void invokeAndWait(Runnable doRun)
          doRun.run() を、AWT イベントディスパッチスレッドで非同期的に実行させます。
static void invokeLater(Runnable doRun)
          doRun.run() を、AWT イベントディスパッチスレッドで非同期的に実行させます。
static boolean isDescendingFrom(Component a, Component b)
          コンポーネント a がコンポーネント b から派生する場合に true を返します。
static boolean isEventDispatchThread()
          現在のスレッドが AWT イベントディスパッチ元スレッドの場合に true を返します。
static boolean isLeftMouseButton(MouseEvent anEvent)
          マウスイベントが左マウスボタンを示す場合に true を返します。
static boolean isMiddleMouseButton(MouseEvent anEvent)
          マウスイベントが中央のマウスボタンを示す場合に true を返します。
static boolean isRectangleContainingRectangle(Rectangle a, Rectangle b)
          ab を保持する場合に true を返します。
static boolean isRightMouseButton(MouseEvent anEvent)
          マウスイベントが右マウスボタンを示す場合に true を返します。
static String layoutCompoundLabel(FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
          アイコンの起点位置、テキストのベースラインの起点位置、および可能であればクリップしたバージョンの複合ラベル文字列を計算して返します。
static String layoutCompoundLabel(JComponent c, FontMetrics fm, String text, Icon icon, int verticalAlignment, int horizontalAlignment, int verticalTextPosition, int horizontalTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int textIconGap)
          アイコンの起点位置、テキストのベースラインの起点位置、および可能であればクリップしたバージョンの複合ラベル文字列を計算して返します。
static boolean notifyAction(Action action, KeyStroke ks, KeyEvent event, Object sender, int modifiers)
          action が使用可能な (かつ null でない) 場合、actionactionPerformed を呼び出します。
static void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h)
          矩形の左上隅およびサイズを指定して、指定された矩形内の任意のグラフィックス g でコンポーネント c をペイントします。
static void paintComponent(Graphics g, Component c, Container p, Rectangle r)
          Rectangle オブジェクトを指定して、指定された矩形内の任意のグラフィックス g でコンポーネント c をペイントします。
static void replaceUIActionMap(JComponent component, ActionMap uiActionMap)
          component の UI ActionMap を uiActionMap に変更するのに便利なメソッドです。
static void replaceUIInputMap(JComponent component, int type, InputMap uiInputMap)
          component の UI InputMap を uiInputMap に変更するのに便利なメソッドです。
static void updateComponentTreeUI(Component c)
          単純な Look & Feel の変更で、ツリー内の各ノードに updateUI() 処理を行うこと、つまり現在の Look & Feel でその UI プロパティを初期化することを要求します。
static Window windowForComponent(Component aComponent)
          aComponent のウィンドウを返します。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

メソッドの詳細

isRectangleContainingRectangle

public static final boolean isRectangleContainingRectangle(Rectangle a,
                                                           Rectangle b)
ab を保持する場合に true を返します。

getLocalBounds

public static Rectangle getLocalBounds(Component aComponent)
aComponent コンポーネントの矩形 (0,0,bounds.width,bounds.height) を返します。

getWindowAncestor

public static Window getWindowAncestor(Component c)
戻り値:
Window である c の最初の上位オブジェクト。コンポーネントがウィンドウ内に含まれていない場合は null

convertPoint

public static Point convertPoint(Component source,
                                 Point aPoint,
                                 Component destination)
source 座標体系の aPointdestination 座標体系に変換します。source が null の場合、aPointdestination のルートコンポーネント座標体系にあるものと想定されます。destination が null の場合、aPointsource のルートコンポーネント座標体系に変換されます。sourcedestination がどちらとも null の場合、変換しないで aPoint を返します。

convertPoint

public static Point convertPoint(Component source,
                                 int x,
                                 int y,
                                 Component destination)
source 座標体系の点 (x,y)destination 座標体系に変換します。source が null の場合、(x,y)destination のルートコンポーネント座標体系にあるものと想定されます。destination が null の場合、(x,y)source のルートコンポーネント座標体系に変換されます。sourcedestination がどちらとも null の場合、変換しないで (x,y) を返します。

convertRectangle

public static Rectangle convertRectangle(Component source,
                                         Rectangle aRectangle,
                                         Component destination)
source 座標体系の aRectangledestination 座標体系に変換します。source が null の場合、aRectangledestination のルートコンポーネント座標体系にあるものと想定されます。destination が null の場合、aRectanglesource のルートコンポーネント座標体系に変換されます。sourcedestination がどちらとも null の場合、変換しないで aRectangle を返します。

getAncestorOfClass

public static Container getAncestorOfClass(Class c,
                                           Component comp)
コンポーネント階層の上位の comp を検索するための簡易メソッドであり、見つかった c クラスの最初のオブジェクトを返します。c クラスが見つからない場合は null を返します。

getAncestorNamed

public static Container getAncestorNamed(String name,
                                         Component comp)
コンポーネント階層の上記の comp を検索するための簡易メソッドであり、見つかった name の最初のオブジェクトを返します。name が見つからない場合は null を返します。

getDeepestComponentAt

public static Component getDeepestComponentAt(Component parent,
                                              int x,
                                              int y)
位置 xy を内包する parent を親として持つ、最下位の可視 Component を返します。parent が指定された位置を内包していない場合は、null が返されます。parent がコンテナではない場合、あるいは parent の可視の子がどれも指定された位置を内包していない場合は、parent が返されます。
パラメータ:
parent - 検索を開始するルートコンポーネント
x - x ターゲット位置
y - y ターゲット位置

convertMouseEvent

public static MouseEvent convertMouseEvent(Component source,
                                           MouseEvent sourceEvent,
                                           Component destination)
その x と y メンバが destination の座標体系に変換済みの場合を除いて、sourceEvent と同じような MouseEvent を返します。source が null の場合、sourceEvent の x と y メンバは destination のルートコンポーネント座標体系に入るものと想定されます。destinationnull の場合、返された MouseEvent は source の座標体系に入ります。sourceEvent は変更されません。新しいイベントが返されます。destination が null 以外の場合、返されたイベントの source フィールドは destination に設定されます。translateMouseEvent() メソッドを使うと、source を変更しないであるコンポーネントのマウスイベントを別のコンポーネントに変換できます。

convertPointToScreen

public static void convertPointToScreen(Point p,
                                        Component c)
ポイントをコンポーネントの座標体系から画面座標に変換します。
パラメータ:
p - Point オブジェクト (新しい座標体系に変換される)
c - Component オブジェクト

convertPointFromScreen

public static void convertPointFromScreen(Point p,
                                          Component c)
ポイントを画面座標からコンポーネントの座標体系に変換します。
パラメータ:
p - Point オブジェクト (新しい座標体系に変換される)
c - Component オブジェクト

windowForComponent

public static Window windowForComponent(Component aComponent)
aComponent のウィンドウを返します。

isDescendingFrom

public static boolean isDescendingFrom(Component a,
                                       Component b)
コンポーネント a がコンポーネント b から派生する場合に true を返します。

computeIntersection

public static Rectangle computeIntersection(int x,
                                            int y,
                                            int width,
                                            int height,
                                            Rectangle dest)
新しい矩形を割り当てずに、2 つの矩形の共通部分を計算するのに便利です。2 つの矩形が交差していない場合、返される矩形は (0,0) の位置から始まり、0 の幅と 0 の高さを持ちます。
パラメータ:
x - 最初の矩形の左上の点の X 座標
y - 最初の矩形の左上の点の Y 座標
width - 最初の矩形の幅
height - 最初の矩形の高さ
dest - 2 番目の矩形
戻り値:
共通部分を指定するために変更された dest

computeUnion

public static Rectangle computeUnion(int x,
                                     int y,
                                     int width,
                                     int height,
                                     Rectangle dest)
新しい矩形 dest を割り当てずに、2 つの矩形の和集合を計算するのに便利です。

computeDifference

public static Rectangle[] computeDifference(Rectangle rectA,
                                            Rectangle rectB)
rectB とオーバーラップしない rectA 内の領域を表現する矩形の配列を返すために使われます。2 つの矩形がオーバーラップしない場合は、空の配列を返します。

isLeftMouseButton

public static boolean isLeftMouseButton(MouseEvent anEvent)
マウスイベントが左マウスボタンを示す場合に true を返します。
パラメータ:
anEvent - MouseEvent オブジェクト
戻り値:
左マウスボタンがアクティブだった場合は true

isMiddleMouseButton

public static boolean isMiddleMouseButton(MouseEvent anEvent)
マウスイベントが中央のマウスボタンを示す場合に true を返します。
パラメータ:
anEvent - MouseEvent オブジェクト
戻り値:
中央のマウスボタンがアクティブだった場合は true

isRightMouseButton

public static boolean isRightMouseButton(MouseEvent anEvent)
マウスイベントが右マウスボタンを示す場合に true を返します。
パラメータ:
anEvent - MouseEvent オブジェクト
戻り値:
右マウスボタンがアクティブだった場合は true

computeStringWidth

public static int computeStringWidth(FontMetrics fm,
                                     String str)
指定されたメトリックス (サイズ) を持つフォントを使って文字列の幅を計算します。
パラメータ:
fm - 計算に使う FontMetrics オブジェクト
str - 計算対象の String
戻り値:
文字列の幅が格納されている int 値

layoutCompoundLabel

public static String layoutCompoundLabel(JComponent c,
                                         FontMetrics fm,
                                         String text,
                                         Icon icon,
                                         int verticalAlignment,
                                         int horizontalAlignment,
                                         int verticalTextPosition,
                                         int horizontalTextPosition,
                                         Rectangle viewR,
                                         Rectangle iconR,
                                         Rectangle textR,
                                         int textIconGap)
アイコンの起点位置、テキストのベースラインの起点位置、および可能であればクリップしたバージョンの複合ラベル文字列を計算して返します。各位置は viewR の矩形を基準に計算されます。JComponent の方向 (LEADING または TRAILING) も考慮され、LEFT 値または RIGHT 値に変換されます。

layoutCompoundLabel

public static String layoutCompoundLabel(FontMetrics fm,
                                         String text,
                                         Icon icon,
                                         int verticalAlignment,
                                         int horizontalAlignment,
                                         int verticalTextPosition,
                                         int horizontalTextPosition,
                                         Rectangle viewR,
                                         Rectangle iconR,
                                         Rectangle textR,
                                         int textIconGap)
アイコンの起点位置、テキストのベースラインの起点位置、および可能であればクリップしたバージョンの複合ラベル文字列を計算して返します。各位置は viewR の矩形を基準に計算されます。この layoutCompoundLabel() は、horizontalTextPosition (デフォルトは RIGHT) および horizontalAlignmentdoes (デフォルトは CENTER) の LEADING 値および TRAILING 値を処理できません。代わりに、ほかのバージョンの layoutCompoundLabel() を使ってください。

paintComponent

public static void paintComponent(Graphics g,
                                  Component c,
                                  Container p,
                                  int x,
                                  int y,
                                  int w,
                                  int h)
矩形の左上隅およびサイズを指定して、指定された矩形内の任意のグラフィックス g でコンポーネント c をペイントします。コンポーネントは、c.validate() 呼び出しと c.repaint() 呼び出しがツリーに伝播しないようにするプライベートコンテナ (その親が p になる) を親に設定します。この中間コンテナには、これ以外の効果はありません。
パラメータ:
g - 描画先の Graphics オブジェクト
c - 描画対象の Component
p - 中間コンテナ
x - 描画領域の左端を表す int 値 (ピクセル単位)。グラフィックスコンテキストの左端を基準とする
y - 描画領域の上端を表す int 値 (ピクセル単位)。グラフィックスコンテキストの上端を基準とする
w - 描画領域の幅を表す int 値 (ピクセル単位)
h - 描画領域の高さを表す int 値 (ピクセル単位)

paintComponent

public static void paintComponent(Graphics g,
                                  Component c,
                                  Container p,
                                  Rectangle r)
Rectangle オブジェクトを指定して、指定された矩形内の任意のグラフィックス g でコンポーネント c をペイントします。コンポーネントは、c.validate() 呼び出しと c.repaint() 呼び出しがツリーに伝播しないようにするプライベートコンテナ (その親が p になる) を親に設定します。この中間コンテナには、これ以外の効果はありません。
パラメータ:
g - 描画先の Graphics オブジェクト
c - 描画対象の Component
p - 中間コンテナ
r - 描画先の Rectangle

updateComponentTreeUI

public static void updateComponentTreeUI(Component c)
単純な Look & Feel の変更で、ツリー内の各ノードに updateUI() 処理を行うこと、つまり現在の Look & Feel でその UI プロパティを初期化することを要求します。

invokeLater

public static void invokeLater(Runnable doRun)
doRun.run() を、AWT イベントディスパッチスレッドで非同期的に実行させます。これは、保留中のすべての AWT イベントが処理されたあとに発生します。このメソッドは、アプリケーションスレッドが GUI を更新する必要があるときに使用されます。次の例では、invokeLater 呼び出しはイベントディスパッチスレッドに Runnable オブジェクトの doHelloWorld のキューを呼び出してから、メッセージを出力します。
 Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 SwingUtilities.invokeLater(doHelloWorld);
 System.out.println("This might well be displayed before the other message.");
invokeLater がイベントディスパッチスレッド、たとえば JButton の ActionListener から呼び出された場合、doRun.run() は保留中のすべてのイベントが処理されるまで実行が延期されます。ただし、doRun.run() がキャッチされない例外をスローする場合はイベントディスパッチスレッド (現在のスレッドではない) が状態を元に戻すので、注意してください。

このメソッドの追加のドキュメントと例については、「The Java Tutorial」「How to Use Threads」を参照してください。

JDK バージョン 1.3 以降、このメソッドは java.awt.EventQueue.invokeLater() でだけ使用されます。

関連項目:
invokeAndWait(java.lang.Runnable)

invokeAndWait

public static void invokeAndWait(Runnable doRun)
                          throws InterruptedException,
                                 InvocationTargetException
doRun.run() を、AWT イベントディスパッチスレッドで非同期的に実行させます。これは、保留中のすべての AWT イベントが処理されるまでブロックされ、次に doRun.run() が復帰します。このメソッドは、アプリケーションスレッドが GUI を更新する必要があるときに使用されます。これは、EventDispatchThread から呼び出さないでください。次に、invokeAndWait() を使ってイベントディスパッチスレッドから文字列の出力を終えたあとにそれ自身から文字列を出力する新しいアプリケーションスレッドを生成する例を示します。
 final Runnable doHelloWorld = new Runnable() {
     public void run() {
         System.out.println("Hello World on " + Thread.currentThread());
     }
 };

 Thread appThread = new Thread() {
     public void run() {
         try {
             SwingUtilities.invokeAndWait(doHelloWorld);
         }
         catch (Exception e) {
             e.printStackTrace();
         }
         System.out.println("Finished on " + Thread.currentThread());
     }
 };
 appThread.start();
ただし、Runnable.run() メソッドがキャッチされない例外を (イベントディスパッチ元スレッドで) スローする場合は、その例外は呼び出し側スレッドで、InvocationTargetException としてキャッチされて再スローされるので注意してください。

このメソッドの追加のドキュメントと例については、「The Java Tutorial」「How to Use Threads」を参照してください。

JDK バージョン 1.3 以降、このメソッドは java.awt.EventQueue.invokeAndWait() でだけ使用されます。

例外:
InterruptedException - イベントディスパッチスレッドが doRun.run() の実行を終えるのを待つ間に割り込みを受けた場合
InvocationTargetException - doRun.run() がスローする場合
関連項目:
invokeLater(java.lang.Runnable)

isEventDispatchThread

public static boolean isEventDispatchThread()
現在のスレッドが AWT イベントディスパッチ元スレッドの場合に true を返します。

JDK バージョン 1.3 以降、このメソッドは java.awt.EventQueue.isEventDispatchThread() でだけ使用されます。

戻り値:
現在のスレッドが AWT イベントディスパッチスレッドの場合は true

getAccessibleIndexInParent

public static int getAccessibleIndexInParent(Component c)
ユーザ補助機能を実装する親でのこのオブジェクトのインデックスを返します。

注: Java 2 プラットフォーム v1.3 以降、開発者はこのメソッドを使用する代わりに、Component.AccessibleAWTComponent.getAccessibleIndexInParent() を呼び出すことをお勧めします。

戻り値:
このオブジェクトがユーザ補助機能を実装する親を持たない場合は -1。そうでない場合は、そのユーザ補助機能を実装する親の子のインデックス

getAccessibleAt

public static Accessible getAccessibleAt(Component c,
                                         Point p)
ローカル座標の Point にユーザ補助機能を実装する子が保持されている場合はそれを返します。
戻り値:
指定された位置に存在する場合は Accessible

getAccessibleStateSet

public static AccessibleStateSet getAccessibleStateSet(Component c)
このオブジェクトの状態を返します。

注: Java 2 プラットフォーム v1.3 以降、開発者はこのメソッドを使用する代わりに、Component.AccessibleAWTComponent.getAccessibleIndexInParent() を呼び出すことをお勧めします。

戻り値:
オブジェクトの現在の状態セットを保持する AccessibleStateSet のインスタンス
関連項目:
AccessibleState

getAccessibleChildrenCount

public static int getAccessibleChildrenCount(Component c)
オブジェクト内のユーザ補助機能を実装する子の数を返します。このオブジェクトの子のすべてが Accessible インタフェースを実装する場合、このメソッドはこのオブジェクトの子の数を返さなければなりません。

注: Java 2 プラットフォーム v1.3 以降、開発者はこのメソッドを使用する代わりに、Component.AccessibleAWTComponent.getAccessibleIndexInParent() を呼び出すことをお勧めします。

戻り値:
オブジェクト内のユーザ補助機能を実装する子の数

getAccessibleChild

public static Accessible getAccessibleChild(Component c,
                                            int i)
オブジェクトのユーザ補助機能を実装する n 番目の子を返します。

注: Java 2 プラットフォーム v1.3 以降、開発者はこのメソッドを使用する代わりに、Component.AccessibleAWTComponent.getAccessibleIndexInParent() を呼び出すことをお勧めします。

パラメータ:
i - ゼロから始まる子のインデックス
戻り値:
オブジェクトのユーザ補助機能を実装する n 番目の子

findFocusOwner

public static Component findFocusOwner(Component c)
フォーカスを持つ子コンポーネントがある場合はそれを返します。HotJava SecurityManager はアプレットが getFocusOwner() にアクセスするのを禁止するので、コンポーネントがアプレットである場合は、JComponent がフォーカスを持つかどうかを調べます。HotJava でのアプレット内の Swing 以外のコンポーネントは対象外です。

getRootPane

public static JRootPane getRootPane(Component c)
c が下位 JRootPane オブジェクトの場合は、その上位 JRootPane オブジェクトを返します。c が RootPaneContainer の場合は、その JRootPane を返します。
戻り値:
Component c の JRootPane、または null

getRoot

public static Component getRoot(Component c)
現在のコンポーネントツリーのルートコンポーネントを返します。
戻り値:
Window である c の最初の上位オブジェクト、または最後の上位 Applet オブジェクト

notifyAction

public static boolean notifyAction(Action action,
                                   KeyStroke ks,
                                   KeyEvent event,
                                   Object sender,
                                   int modifiers)
action が使用可能な (かつ null でない) 場合、actionactionPerformed を呼び出します。ActionEvent のコマンドは次の値で指定されます。
  1. アクションが registerKeyboardAction を使って登録された場合に、渡されたコマンド文字列 (null が渡された場合は、null が使用される)
  2. null でない限り、Action.ACTION_COMMAND_KEY という名前を持つ Action 値
  3. getKeyChar が KeyEvent.CHAR_UNDEFINED を返さない限り、KeyEvent の String 値
action が null 以外で、actionPerformed が呼び出されると、true を返します。
導入されたバージョン:
1.3

replaceUIInputMap

public static void replaceUIInputMap(JComponent component,
                                     int type,
                                     InputMap uiInputMap)
component の UI InputMap を uiInputMap に変更するのに便利なメソッドです。uiInputMap が null の場合、このメソッドは以前にインストールされた UI InputMap を削除します。
導入されたバージョン:
1.3

replaceUIActionMap

public static void replaceUIActionMap(JComponent component,
                                      ActionMap uiActionMap)
component の UI ActionMap を uiActionMap に変更するのに便利なメソッドです。uiActionMap が null の場合、このメソッドは以前にインストールされた UI ActionMap を削除します。
導入されたバージョン:
1.3

getUIInputMap

public static InputMap getUIInputMap(JComponent component,
                                     int condition)
UI が componentcondition に指定した InputMap を返します。

このメソッドは、UI が指定された型の InputMap をインストールしていない場合に null を返します。

導入されたバージョン:
1.3

getUIActionMap

public static ActionMap getUIActionMap(JComponent component)
UI が component に指定した ActionMap を返します。

このメソッドは、UI が指定された型の ActionMap をインストールしていない場合に null を返します。

導入されたバージョン:
1.3

JavaTM 2 Platform
Std. Ed. v1.3

バグや機能要求の報告
さらに詳しい API リファレンスおよび開発者ドキュメントについては、 Java 2 SDK SE Developer Documentation を参照してください。このドキュメントには、概念、用語の定義、回避策、 実用的なコード例など、開発者を対象にした詳細な解説が掲載されています。

Java、Java 2D、JDBC は、米国およびその他の国における米国 Sun Microsystems, Inc. の商標もしくは登録商標です。
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.