javax.swing.text
クラス StyledEditorKit.ForegroundAction
java.lang.Object
|
+--javax.swing.AbstractAction
|
+--javax.swing.text.TextAction
|
+--javax.swing.text.StyledEditorKit.StyledTextAction
|
+--javax.swing.text.StyledEditorKit.ForegroundAction
- すべての実装インタフェース:
- Action, ActionListener, Cloneable, EventListener, Serializable
- 含まれているクラス:
- StyledEditorKit
- public static class StyledEditorKit.ForegroundAction
- extends StyledEditorKit.StyledTextAction
フォアグラウンドカラーを設定するアクションです。このクラスは、ターゲットの JEditorPane で現在選択されている領域に使用する StyleConstants.Foreground
属性を設定します。これは、ターゲットの JEditorPane に関連した書式付ドキュメントに対して StyledDocument.setCharacterAttributes
を呼び出すことで行われます。
ターゲットのテキストコンポーネントが ActionEvent の発生源として指定されている場合、コマンド文字列があるときは、そのコマンド文字列がフォアグラウンドカラーとして解釈されます。解釈は Color.decode
を呼び出して行われるため、コマンド文字列はこのメソッドに対する有効な入力でなければなりません。
警告:
このクラスの直列化されたオブジェクトは、今後の Swing リリースと互換ではなくなる予定です。現在の直列化のサポートは、短期間の運用や、同じバージョンの Swing を実行するアプリケーション間の RMI に適しています。今後の Swing リリースでは、長期間の持続性をサポートする予定です。
- 関連項目:
- 直列化された形式
StyledEditorKit.ForegroundAction
public StyledEditorKit.ForegroundAction(String nm,
Color fg)
- 新しい ForegroundAction を作成します。
- パラメータ:
nm
- アクション名fg
- フォアグラウンドカラー
actionPerformed
public void actionPerformed(ActionEvent e)
- フォアグラウンドカラーを設定します。
- パラメータ:
e
- アクションイベント
バグや機能要求の報告
さらに詳しい 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.