| パッケージ | 説明 | 
|---|---|
| javax.swing | すべてのプラットフォーム上で可能なかぎり同じように機能する「軽量」(Java共通言語)コンポーネントのセットを提供します。 | 
| javax.swing.plaf | 1つのインタフェースおよび多くのabstractクラスを提供しており、Swingはプラグイン可能なLook & Feel機能を提供するためにこれらを利用します。 | 
| javax.swing.plaf.basic | 基本Look & Feelに従って構築されたユーザー・インタフェース・オブジェクトを提供します。 | 
| javax.swing.plaf.multi | 複数のLook & Feelを結合するユーザー・インタフェース・オブジェクトを提供します。 | 
| javax.swing.text | 編集可能なテキスト・コンポーネントと編集不能なテキスト・コンポーネントを処理するクラスとインタフェースを提供します。 | 
| javax.swing.text.html | HTMLテキスト・エディタを作成するためのクラス HTMLEditorKitとサポート・クラスを提供します。 | 
| javax.swing.text.rtf | Rich-Text-Formatテキスト・エディタを作成するためのクラス( RTFEditorKit)を提供します。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| int | JTextArea. getLineEndOffset(int line)指定された行の終了オフセットを返します。 | |
| int | JTextArea. getLineOfOffset(int offset)コンポーネント・テキストのオフセットを行番号に変換します。 | |
| int | JTextArea. getLineStartOffset(int line)指定された行の開始オフセットを返します。 | |
| String | JPasswordField. getText(int offs, int len)非推奨。 
 Java 2プラットフォームv1.2以降は、 getPasswordに置き換えられています。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| abstract int | TextUI. getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| abstract Rectangle | TextUI. modelToView(JTextComponent t, int pos)モデル内の指定された位置を、ビュー座標体系内の場所に変換します。 | |
| abstract Rectangle | TextUI. modelToView(JTextComponent t, int pos, Position.Bias bias)モデル内の指定された位置を、ビュー座標体系内の場所に変換します。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| int | BasicTextUI. getNextVisualPositionFrom(JTextComponent t, int pos, Position.Bias b, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| Rectangle | BasicTextUI. modelToView(JTextComponent tc, int pos)モデル内の指定された位置を、ビュー座標体系内の場所に変換します。 | |
| Rectangle | BasicTextUI. modelToView(JTextComponent tc, int pos, Position.Bias bias)モデル内の指定された位置を、ビュー座標体系内の場所に変換します。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| int | MultiTextUI. getNextVisualPositionFrom(JTextComponent a, int b, Position.Bias c, int d, Position.Bias[] e)このオブジェクトで処理されている各UIで getNextVisualPositionFromメソッドを呼び出します。 | |
| Rectangle | MultiTextUI. modelToView(JTextComponent a, int b)このオブジェクトで処理されている各UIで modelToViewメソッドを呼び出します。 | |
| Rectangle | MultiTextUI. modelToView(JTextComponent a, int b, Position.Bias c)このオブジェクトで処理されている各UIで modelToViewメソッドを呼び出します。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| Object | DefaultHighlighter. addHighlight(int p0, int p1, Highlighter.HighlightPainter p)ビューにハイライトを追加します。 | |
| Object | Highlighter. addHighlight(int p0, int p1, Highlighter.HighlightPainter p)ビューにハイライトを追加します。 | |
| void | DefaultHighlighter. changeHighlight(Object tag, int p0, int p1)ハイライトを変更します。 | |
| void | Highlighter. changeHighlight(Object tag, int p0, int p1)指定されたハイライトを、ドキュメントの異なる部分を占めるように変更します。 | |
| Position | GapContent. createPosition(int offset)コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。 | |
| Position | StringContent. createPosition(int offset)コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。 | |
| Position | AbstractDocument. createPosition(int offs)ドキュメントが変更されたときに、変更を追跡する位置を返します。 | |
| Position | AbstractDocument.Content. createPosition(int offset)コンテンツが変更されたときに変更を追跡するコンテンツ内の位置を作成します。 | |
| Position | Document. createPosition(int offs)このメソッドを使用すると文字コンテンツのシーケンスの位置にマークが付けられます。 | |
| protected int | PasswordView. drawSelectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を、選択されたテキストとしてレンダリングします。 | |
| protected int | PlainView. drawSelectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を、選択されたテキストとしてレンダリングします。 | |
| protected int | WrappedPlainView. drawSelectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を、選択されたテキストとしてレンダリングします。 | |
| protected int | PasswordView. drawUnselectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を通常の選択されていないテキストとしてレンダリングします。 | |
| protected int | PlainView. drawUnselectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を通常の選択されていないテキストとしてレンダリングします。 | |
| protected int | WrappedPlainView. drawUnselectedText(Graphics g, int x, int y, int p0, int p1)モデル内の指定された範囲を通常の選択されていないテキストとしてレンダリングします。 | |
| void | GapContent. getChars(int where, int len, Segment chars)コンテンツの一部を取り出します。 | |
| void | StringContent. getChars(int where, int len, Segment chars)コンテンツの一部を取り出します。 | |
| void | AbstractDocument.Content. getChars(int where, int len, Segment txt)文字のシーケンスを取得して、セグメントにコピーします。 | |
| protected int | ParagraphView. getClosestPositionTo(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet, int rowIndex, int x)xにもっとも近接したモデル内の位置を返します。 | |
| protected int | CompositeView. getNextEastWestVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)カーソルを置くことのできる、次の視覚的な位置を返します。方向は右(east)または左(west)になります。 | |
| protected int | CompositeView. getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)カーソルを置くことのできる、次の視覚的な位置を返します。方向は上(north)または下(south)になります。 | |
| protected int | ParagraphView. getNextNorthSouthVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)カーソルを置くことのできる、次の視覚的な位置を返します。方向は右(east)または左(west)になります。 | |
| int | GlyphView.GlyphPainter. getNextVisualPositionFrom(GlyphView v, int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| int | AsyncBoxView. getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| int | GlyphView. getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| int | CompositeView. getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| int | View. getNextVisualPositionFrom(int pos, Position.Bias b, Shape a, int direction, Position.Bias[] biasRet)キャレットが配置される可能性のある、視覚的に表された次のモデル位置を決定する手段を提供します。 | |
| int | NavigationFilter. getNextVisualPositionFrom(JTextComponent text, int pos, Position.Bias bias, int direction, Position.Bias[] biasRet)既存の位置からキャレットを置くことのできる、次の可視位置を返します。 | |
| static int | Utilities. getNextWord(JTextComponent c, int offs)指定された位置の次の語の開始位置を決定します。 | |
| static int | Utilities. getPositionAbove(JTextComponent c, int offs, int x)上の行で指定されたビュー位置にもっとも近いモデル内の位置を決定します。 | |
| static int | Utilities. getPositionBelow(JTextComponent c, int offs, int x)下の行で指定されたビュー位置にもっとも近いモデル内の位置を決定します。 | |
| static int | Utilities. getPreviousWord(JTextComponent c, int offs)指定された位置の直前の語の開始位置を指定します。 | |
| static int | Utilities. getRowEnd(JTextComponent c, int offs)指定されたモデル位置を含む行の、終了行モデル位置を指定します。 | |
| static int | Utilities. getRowStart(JTextComponent c, int offs)指定されたモデル位置を含む行の、開始行モデル位置を指定します。 | |
| String | GapContent. getString(int where, int len)コンテンツの一部を取り出します。 | |
| String | StringContent. getString(int where, int len)コンテンツの一部を取り出します。 | |
| String | AbstractDocument.Content. getString(int where, int len)シーケンスに含まれる文字列を返します。 | |
| protected String | AbstractWriter. getText(Element elem)要素に関連したテキストを返します。 | |
| String | AbstractDocument. getText(int offset, int length)ドキュメントからテキストのシーケンスを取得します。 | |
| String | Document. getText(int offset, int length)ドキュメントの指定部分内にあるテキストを取得します。 | |
| String | JTextComponent. getText(int offs, int len)コンポーネントが表すテキストの一部を取り出します。 | |
| void | AbstractDocument. getText(int offset, int length, Segment txt)ドキュメントの指定部分内にあるテキストを取得します。 | |
| void | Document. getText(int offset, int length, Segment txt)ドキュメントの指定部分内にあるテキストを取得します。 | |
| static int | Utilities. getWordEnd(JTextComponent c, int offs)指定された位置の語の終了位置を決定します。 | |
| static int | Utilities. getWordStart(JTextComponent c, int offs)指定されたモデル位置の語の開始位置を決定します。 | |
| protected void | DefaultStyledDocument. insert(int offset, DefaultStyledDocument.ElementSpec[] data)新しい要素を一括して挿入します。 | |
| void | DocumentFilter. insertString(DocumentFilter.FilterBypass fb, int offset, String string, AttributeSet attr)指定したDocumentにテキストを挿入する前に呼び出されます。 | |
| UndoableEdit | GapContent. insertString(int where, String str)コンテンツに文字列を挿入します。 | |
| UndoableEdit | StringContent. insertString(int where, String str)コンテンツに文字列を挿入します。 | |
| UndoableEdit | AbstractDocument.Content. insertString(int where, String str)シーケンスに文字列を挿入します。 | |
| void | PlainDocument. insertString(int offs, String str, AttributeSet a)ドキュメントに内容を挿入します。 | |
| void | AbstractDocument. insertString(int offs, String str, AttributeSet a)ドキュメントに内容を挿入します。 | |
| abstract void | DocumentFilter.FilterBypass. insertString(int offset, String string, AttributeSet attr)DocumentFilterをバイパスして、指定テキストを挿入します。 | |
| void | Document. insertString(int offset, String str, AttributeSet a)コンテンツの文字列を挿入します。 | |
| abstract Shape | GlyphView.GlyphPainter. modelToView(GlyphView v, int pos, Position.Bias bias, Shape a)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Rectangle | JTextComponent. modelToView(int pos)モデル内の指定された位置を、ビュー座標体系内の場所に変換します。 | |
| Shape | CompositeView. modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | View. modelToView(int p0, Position.Bias b0, int p1, Position.Bias b1, Shape a)指定した範囲について、ドキュメント・モデル座標空間からビュー座標空間へのマッピングを提供します。 | |
| Shape | View. modelToView(int pos, Shape a)非推奨。   | |
| Shape | ComponentView. modelToView(int pos, Shape a, Position.Bias b)モデルの座標空間から、ビューの座標空間へのマッピングを提供します。 | |
| Shape | PasswordView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | PlainView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | FieldView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | IconView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | AsyncBoxView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | GlyphView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | CompositeView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| Shape | BoxView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| abstract Shape | View. modelToView(int pos, Shape a, Position.Bias b)指定した文字について、ドキュメント・モデル座標空間からビュー座標空間へのマッピングを提供します。 | |
| void | DefaultEditorKit. read(InputStream in, Document doc, int pos)このタイプのコンテンツ・ハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。 | |
| abstract void | EditorKit. read(InputStream in, Document doc, int pos)このタイプのコンテンツ・ハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。 | |
| void | DefaultEditorKit. read(Reader in, Document doc, int pos)指定されたストリームから内容を挿入します。内容はプレーン・テキストとして扱われます。 | |
| abstract void | EditorKit. read(Reader in, Document doc, int pos)このタイプのコンテンツ・ハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。 | |
| void | DocumentFilter. remove(DocumentFilter.FilterBypass fb, int offset, int length)指定したDocumentの指定した範囲を削除する前に呼び出されます。 | |
| UndoableEdit | GapContent. remove(int where, int nitems)コンテンツの一部を削除します。 | |
| UndoableEdit | StringContent. remove(int where, int nitems)コンテンツの一部を削除します。 | |
| void | AbstractDocument. remove(int offs, int len)ドキュメントから内容を削除します。 | |
| UndoableEdit | AbstractDocument.Content. remove(int where, int nitems)シーケンスの一部を削除します。 | |
| abstract void | DocumentFilter.FilterBypass. remove(int offset, int length)DocumentFilterをバイパスして、テキストの指定領域を削除します。 | |
| void | Document. remove(int offs, int len)ドキュメントのコンテンツの一部を削除します。 | |
| void | DocumentFilter. replace(DocumentFilter.FilterBypass fb, int offset, int length, String text, AttributeSet attrs)指定したDocumentでテキストの範囲を置き換える前に呼び出されます。 | |
| void | AbstractDocument. replace(int offset, int length, String text, AttributeSet attrs)offsetからoffset+lengthまでのテキスト領域を削除し、textに置き換えます。 | |
| abstract void | DocumentFilter.FilterBypass. replace(int offset, int length, String string, AttributeSet attrs)offsetからoffset+lengthまでのテキスト領域を削除し、textに置き換えます。 | |
| protected void | AbstractWriter. text(Element elem)テキストを書き出します。 | |
| protected abstract void | AbstractWriter. write()この抽象メソッドは、サブクラスによって実装される必要があります。 | |
| void | DefaultEditorKit. write(OutputStream out, Document doc, int pos, int len)このタイプのコンテンツ・ハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。 | |
| abstract void | EditorKit. write(OutputStream out, Document doc, int pos, int len)このタイプのコンテンツ・ハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。 | |
| void | DefaultEditorKit. write(Writer out, Document doc, int pos, int len)ドキュメントのコンテンツを、指定されたストリームにプレーン・テキストとして書き込みます。 | |
| abstract void | EditorKit. write(Writer out, Document doc, int pos, int len)このタイプのコンテンツ・ハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| protected void | HTMLWriter. comment(Element elem)コメントを書き出します。 | |
| protected void | HTMLWriter. emptyTag(Element elem)すべての空要素(対応する終了タグのないタグすべて)を書き出します。 | |
| void | HTMLDocument.HTMLReader. flush()HTMLリーダーで呼び出される最後のメソッドです。 | |
| void | HTMLEditorKit.ParserCallback. flush() | |
| protected void | HTMLDocument. insert(int offset, DefaultStyledDocument.ElementSpec[] data)新しい要素を一括して挿入します。 | |
| void | HTMLDocument. insertAfterEnd(Element elem, String htmlText)指定要素が終了後に文字列として指定されたHTMLを挿入します。 | |
| void | HTMLDocument. insertAfterStart(Element elem, String htmlText)要素の開始位置に文字列として指定されたHTMLを挿入します。 | |
| void | HTMLDocument. insertBeforeEnd(Element elem, String htmlText)要素の終了位置に文字列として指定されたHTMLを挿入します。 | |
| void | HTMLDocument. insertBeforeStart(Element elem, String htmlText)指定された要素が開始される前に文字列として指定されたHTMLを挿入します。 | |
| void | HTMLEditorKit. insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag)既存のドキュメントにHTMLを挿入します。 | |
| Shape | ImageView. modelToView(int pos, Shape a, Position.Bias b)ドキュメント・モデルの座標空間からビューの座標空間へのマッピングを提供します。 | |
| void | HTMLEditorKit. read(Reader in, Document doc, int pos)指定されたストリームからコンテンツを挿入します。 | |
| void | HTMLDocument. setInnerHTML(Element elem, String htmlText)指定された要素の子をHTML文字列として指定されたコンテンツと置き換えます。 | |
| void | HTMLDocument. setOuterHTML(Element elem, String htmlText)指定された親の要素をHTML文字列として指定されたコンテンツと置き換えます。 | |
| protected void | HTMLWriter. startTag(Element elem)要素の開始タグを書き出します。 | |
| protected void | MinimalHTMLWriter. text(Element elem)テキストを書き出します。 | |
| protected void | HTMLWriter. text(Element elem)テキストを書き出します。 | |
| protected void | HTMLWriter. textAreaContent(AttributeSet attr)フォーム要素のTEXTAREAに格納されているテキストを書き出します。 | |
| void | MinimalHTMLWriter. write()StyledDocumentからHTML出力を生成します。 | |
| void | HTMLWriter. write()要素ツリーで反復され、すべてのタグとその属性の書込みを制御します。 | |
| void | HTMLEditorKit. write(Writer out, Document doc, int pos, int len)このタイプのコンテンツ・ハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。 | |
| protected void | MinimalHTMLWriter. writeBody()ドキュメント内の要素で反復し、枝の要素か葉の要素かを判断して要素を処理します。 | |
| protected void | MinimalHTMLWriter. writeContent(Element elem, boolean needsIndenting)HTMLに準拠した方法で属性セットを書き出します。 | 
| 修飾子と型 | メソッド | 説明 | 
|---|---|---|
| void | RTFEditorKit. read(InputStream in, Document doc, int pos)このタイプのコンテンツ・ハンドラに適した形式であると予想されるコンテンツを、指定したストリームから挿入します。 | |
| void | RTFEditorKit. read(Reader in, Document doc, int pos)指定されたストリームから内容を挿入します。内容はプレーン・テキストとして扱われます。 | |
| void | RTFEditorKit. write(OutputStream out, Document doc, int pos, int len)このタイプのコンテンツ・ハンドラに適した形式で、ドキュメントからストリームへコンテンツを書き込みます。 | |
| void | RTFEditorKit. write(Writer out, Document doc, int pos, int len)ドキュメントのコンテンツを、指定されたストリームにプレーン・テキストとして書き込みます。 | 
 バグまたは機能を送信 
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。 
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved.  Use is subject to license terms.  Documentation Redistribution Policyも参照してください。