インタフェース
javax.swing.border.Borderの使用

Borderを使用しているパッケージ 
パッケージ 説明
javax.swing
すべてのプラットフォーム上で可能なかぎり同じように機能する「軽量」(Java共通言語)コンポーネントのセットを提供します。
javax.swing.border
Swingコンポーネントの周囲に各種ボーダーを描画するためのクラスおよびインタフェースを提供します。
javax.swing.plaf
1つのインタフェースおよび多くのabstractクラスを提供しており、Swingはプラグイン可能なLook & Feel機能を提供するためにこれらを利用します。
javax.swing.plaf.basic
基本Look & Feelに従って構築されたユーザー・インタフェース・オブジェクトを提供します。
javax.swing.plaf.metal
デフォルトのLook & FeelであるJava Look & Feel (以前のコード名はMetal)に従って構築されたユーザー・インタフェース・オブジェクトを提供します。
javax.swing.table
javax.swing.JTableを処理するためのクラスとインタフェースを提供します。
javax.swing.tree
javax.swing.JTreeを処理するためのクラスとインタフェースを提供します。
  • javax.swingでのBorderの使用

    Borderとして宣言されているjavax.swing内のフィールド 
    修飾子と型 フィールド 説明
    protected static Border DefaultListCellRenderer.noFocusBorder
    フォーカス・ボーダーなし
    Borderを返すjavax.swing内のメソッド 
    修飾子と型 メソッド 説明
    static Border BorderFactory.createBevelBorder​(int type)
    指定されたタイプの斜影ボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createBevelBorder​(int type, Color highlight, Color shadow)
    指定されたハイライトおよび陰影を使って、指定されたタイプの斜影ボーダーを生成します。
    static Border BorderFactory.createBevelBorder​(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
    ハイライト領域および陰影領域の内側および外側の縁に指定された色を使って、指定されたタイプの斜影ボーダーを生成します。
    static Border BorderFactory.createDashedBorder​(Paint paint)
    指定されたpaintの破線ボーダーを作成します。
    static Border BorderFactory.createDashedBorder​(Paint paint, float length, float spacing)
    指定されたpaint、相対的なlength、および相対的なspacingの破線ボーダーを作成します。
    static Border BorderFactory.createDashedBorder​(Paint paint, float thickness, float length, float spacing, boolean rounded)
    指定されたpaintthickness、線形、相対的なlength、および相対的なspacingの破線ボーダーを作成します。
    static Border BorderFactory.createEmptyBorder()
    スペースを一切とらない空のボーダーを生成します。
    static Border BorderFactory.createEmptyBorder​(int top, int left, int bottom, int right)
    上下左右の辺の幅を指定して、スペースをとるが、描画を行わない空のボーダーを生成します。
    static Border BorderFactory.createEtchedBorder()
    ハイライトおよび陰影にコンポーネントの現在のバックグラウンド・カラーを使って、指定されたタイプのエッチング・ボーダーを生成します。
    static Border BorderFactory.createEtchedBorder​(int type)
    ハイライトおよび陰影にコンポーネントの現在のバックグラウンド・カラーを使って、指定されたタイプのエッチング・ボーダーを生成します。
    static Border BorderFactory.createEtchedBorder​(int type, Color highlight, Color shadow)
    指定されたハイライトおよび陰影の色を使って、指定されたタイプのエッチング・ボーダーを生成します。
    static Border BorderFactory.createEtchedBorder​(Color highlight, Color shadow)
    指定されたハイライトおよび陰影の色を使って、指定されたタイプのエッチング・ボーダーを生成します。
    static Border BorderFactory.createLineBorder​(Color color)
    指定された色で線のボーダーを作成します。
    static Border BorderFactory.createLineBorder​(Color color, int thickness)
    指定された色と幅で直線ボーダーを生成します。
    static Border BorderFactory.createLineBorder​(Color color, int thickness, boolean rounded)
    指定された色と太さと隅の形状で直線ボーダーを作成します。
    static Border BorderFactory.createLoweredBevelBorder()
    くぼみ斜影の縁を持つボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createLoweredSoftBevelBorder()
    くぼみの縁および角の丸い斜影ボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createRaisedBevelBorder()
    浮出し斜影の縁を持つボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createRaisedSoftBevelBorder()
    浮出しの縁および角の丸い斜影ボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createSoftBevelBorder​(int type)
    指定されたタイプの角の丸い斜影ボーダーを生成します。ハイライトにはコンポーネントの現在のバックグラウンド・カラーの明るい方の色調が使われ、陰影には暗い方の色調が使われます。
    static Border BorderFactory.createSoftBevelBorder​(int type, Color highlight, Color shadow)
    指定されたハイライトおよび陰影を使って、指定されたタイプの角の丸い斜影ボーダーを生成します。
    static Border BorderFactory.createSoftBevelBorder​(int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner)
    ハイライト領域および陰影領域の内側および外側の縁に指定された色を使って、指定されたタイプの角の丸い斜影ボーダーを生成します。
    static Border BorderFactory.createStrokeBorder​(BasicStroke stroke)
    指定されたstrokeのボーダーを作成します。
    static Border BorderFactory.createStrokeBorder​(BasicStroke stroke, Paint paint)
    指定されたstrokepaintのボーダーを作成します。
    Border JComponent.getBorder()
    このコンポーネントのボーダーを返します。ボーダーが現在設定されていない場合はnullを返します。
    Border JLayer.getBorder()
    ビュー・コンポーネントがjavax.swing.JComponentのインスタンスであれば、その機能をgetView().getBorder()メソッドに委譲し、それ以外の場合はnullを返します。
    Border UIDefaults.getBorder​(Object key)
    keyの値がBorderである場合はそれを返し、それ以外の場合はnullを返します。
    Border UIDefaults.getBorder​(Object key, Locale l)
    指定されたLocalekeyの値がBorderである場合はそれを返し、それ以外の場合はnullを返します。
    static Border UIManager.getBorder​(Object key)
    デフォルトからボーダーを返します。
    static Border UIManager.getBorder​(Object key, Locale l)
    デフォルトから、指定されたロケールに適したボーダーを返します。
    Border JScrollPane.getViewportBorder()
    ビュー・ポートを囲むBorderオブジェクトを返します。
    Border型のパラメータを持つjavax.swing内のメソッド 
    修飾子と型 メソッド 説明
    static CompoundBorder BorderFactory.createCompoundBorder​(Border outsideBorder, Border insideBorder)
    外側および内側の縁に使うボーダー・オブジェクトを指定して複合ボーダーを生成します。
    static TitledBorder BorderFactory.createTitledBorder​(Border border)
    空のタイトルを使用して新しいタイトル・ボーダーを作成します。指定のボーダー・オブジェクト、デフォルトのテキスト位置(現在のルック・アンド・フィールによって決定)、デフォルトの位置揃え(先頭)、デフォルトのフォントおよびテキスト色(現在のルック・アンド・フィールによって決定)を使用します。
    static TitledBorder BorderFactory.createTitledBorder​(Border border, String title)
    既存のボーダーにタイトルを追加します。デフォルトのテキスト位置(現在のルック・アンド・フィールによって決定)、デフォルトの位置揃え(先頭)、デフォルトのフォントおよびテキスト色(現在のルック・アンド・フィールによって決定)を使用します。
    static TitledBorder BorderFactory.createTitledBorder​(Border border, String title, int titleJustification, int titlePosition)
    テキスト位置を指定し、デフォルトのフォントとテキスト色(現在のルック・アンド・フィールによって決定)を使って、既存のボーダーにタイトルを追加します。
    static TitledBorder BorderFactory.createTitledBorder​(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
    指定された位置とフォントで、デフォルト・テキスト・カラー(現在のLook & Feelによって決まる)を使って、既存のボーダーにタイトルを追加します。
    static TitledBorder BorderFactory.createTitledBorder​(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
    指定された位置、フォント、およびカラーで、既存のボーダーにタイトルを追加します。
    protected String JComponent.AccessibleJComponent.getBorderTitle​(Border b)
    (もしあれば)ボーダー階層に沿ってnullではないタイトルが付いたTitledBorderを再帰的に検索します。
    void JComponent.setBorder​(Border border)
    このコンポーネントのボーダーを設定します。
    void JLayer.setBorder​(Border border)
    ビュー・コンポーネントがjavax.swing.JComponentのインスタンスである場合、その機能をgetView().setBorder(Border)メソッドに委譲します。そうでない場合、このメソッドはノー・オペレーションです。
    void JViewport.setBorder​(Border border)
    ビュー・ポートは、通常の親または子のクリッピングでその子(「ビュー」と呼ばれる)を「スクロール」します。通常、ビューはスクロールとは反対の方向に移動します。
    void JScrollPane.setViewportBorder​(Border viewportBorder)
    ビュー・ポートのボーダーを追加します。
  • javax.swing.borderでのBorderの使用

    Borderを実装しているjavax.swing.border内のクラス 
    修飾子と型 クラス 説明
    class  AbstractBorder
    サイズ指定のない空のボーダーを実装するクラスです。
    class  BevelBorder
    単純な2ラインの斜影ボーダーを実装するクラスです。
    class  CompoundBorder
    2つのBorderオブジェクトを合成して単一のボーダーにするために使用する、複合Borderクラスです。合成は、内側Borderオブジェクトを外側Borderオブジェクトのイン・セットの中に入れ子にして行います。
    class  EmptyBorder
    スペースを占めるが描画はしない、空の透過ボーダーを提供するクラスです。
    class  EtchedBorder
    簡単なエッチング・ボーダーを実装するクラスです。浮彫りエッチング、あるいは彫込みエッチングのどちらも可能です。
    class  LineBorder
    直線ボーダーを実装するクラスです。ボーダーの太さは任意、カラーは単色です。
    class  MatteBorder
    塗りつぶしカラーやタイリングされたアイコンを使う飾り縁ボーダーを提供するクラスです。
    class  SoftBevelBorder
    角の丸い浮き出し斜影ボーダーまたはくぼみ斜影ボーダーを実装するクラスです。
    class  StrokeBorder
    任意のストロークのボーダーを実装するクラスです。
    class  TitledBorder
    Stringによるタイトルを位置および位置揃えを指定して追加し、任意のボーダーを実装するクラスです。
    Borderとして宣言されているjavax.swing.border内のフィールド 
    修飾子と型 フィールド 説明
    protected Border TitledBorder.border
    ボーダー。
    protected Border CompoundBorder.insideBorder
    内側のボーダー。
    protected Border CompoundBorder.outsideBorder
    外側のボーダー。
    Borderを返すjavax.swing.border内のメソッド 
    修飾子と型 メソッド 説明
    static Border LineBorder.createBlackLineBorder()
    太さ1でColor.blackのLineBorderを取得するのに便利なメソッドです。
    static Border LineBorder.createGrayLineBorder()
    太さ1でColor.grayのLineBorderを取得するのに便利なメソッドです。
    Border TitledBorder.getBorder()
    タイトル付きボーダーのボーダーを返します。
    Border CompoundBorder.getInsideBorder()
    内側ボーダーのオブジェクトを返します。
    Border CompoundBorder.getOutsideBorder()
    外側ボーダーのオブジェクトを返します。
    Border型のパラメータを持つjavax.swing.border内のメソッド 
    修飾子と型 メソッド 説明
    static Rectangle AbstractBorder.getInteriorRectangle​(Component c, Border b, int x, int y, int width, int height)
    ボーダーのイン・セットから引数の値を減算して矩形を返します。
    void TitledBorder.setBorder​(Border border)
    タイトル付きボーダーのボーダーを設定します。
    Border型のパラメータを持つjavax.swing.border内のコンストラクタ 
    コンストラクタ 説明
    CompoundBorder​(Border outsideBorder, Border insideBorder)
    指定された内側ボーダーおよび外側ボーダーによる複合ボーダーを作成します。
    TitledBorder​(Border border)
    指定されたボーダーと空のタイトルで、TitledBorderのインスタンスを生成します。
    TitledBorder​(Border border, String title)
    指定されたボーダーでTitledBorderのインスタンスを生成します。
    TitledBorder​(Border border, String title, int titleJustification, int titlePosition)
    指定されたボーダー、タイトル、タイトルの位置揃え、およびタイトルの配置で、TitledBorderのインスタンスを生成します。
    TitledBorder​(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
    指定されたボーダー、タイトル、タイトル位置揃え、タイトル位置、およびタイトル・フォントで、TitledBorderのインスタンスを生成します。
    TitledBorder​(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
    指定されたボーダー、タイトル、タイトル位置揃え、タイトル位置、タイトル・フォント、およびタイトル・カラーで、TitledBorderのインスタンスを生成します。
  • javax.swing.plafでのBorderの使用

    Borderを実装しているjavax.swing.plaf内のクラス 
    修飾子と型 クラス 説明
    class  BorderUIResource
    UIResourceを実装するBorderラッパー・クラスです。
    static class  BorderUIResource.BevelBorderUIResource
    ベベル・ボーダーのUIリソース。
    static class  BorderUIResource.CompoundBorderUIResource
    複合ボーダーUIリソース。
    static class  BorderUIResource.EmptyBorderUIResource
    空のボーダーUIリソース。
    static class  BorderUIResource.EtchedBorderUIResource
    エッチングされたボーダーUIリソース。
    static class  BorderUIResource.LineBorderUIResource
    ライン・ボーダーのUIリソース。
    static class  BorderUIResource.MatteBorderUIResource
    マット・ボーダーのUIリソース。
    static class  BorderUIResource.TitledBorderUIResource
    タイトル付きボーダーUIリソース。
    Borderを返すjavax.swing.plaf内のメソッド 
    修飾子と型 メソッド 説明
    static Border BorderUIResource.getBlackLineBorderUIResource()
    黒い線のボーダーのUIリソースを返します。
    static Border BorderUIResource.getEtchedBorderUIResource()
    エッチングされたボーダーUIリソースを返します。
    static Border BorderUIResource.getLoweredBevelBorderUIResource()
    下げべベル・ボーダーUIリソースを返します。
    static Border BorderUIResource.getRaisedBevelBorderUIResource()
    上げべベル・ボーダーUIリソースを返します。
    Border型のパラメータを持つjavax.swing.plaf内のコンストラクタ 
    コンストラクタ 説明
    BorderUIResource​(Border delegate)
    既存のBorderインスタンスをラップする、UIResourceのボーダー・オブジェクトを作成します。
    CompoundBorderUIResource​(Border outsideBorder, Border insideBorder)
    CompoundBorderUIResourceを構築します。
    TitledBorderUIResource​(Border border)
    TitledBorderUIResourceを構築します。
    TitledBorderUIResource​(Border border, String title)
    TitledBorderUIResourceを構築します。
    TitledBorderUIResource​(Border border, String title, int titleJustification, int titlePosition)
    TitledBorderUIResourceを構築します。
    TitledBorderUIResource​(Border border, String title, int titleJustification, int titlePosition, Font titleFont)
    TitledBorderUIResourceを構築します。
    TitledBorderUIResource​(Border border, String title, int titleJustification, int titlePosition, Font titleFont, Color titleColor)
    TitledBorderUIResourceを構築します。
  • javax.swing.plaf.basicでのBorderの使用

    Borderを実装しているjavax.swing.plaf.basic内のクラス 
    修飾子と型 クラス 説明
    static class  BasicBorders.ButtonBorder
    ボタンの周りにボーダーを描画します。
    static class  BasicBorders.FieldBorder
    フィールドの周りにボーダーを描画します。
    static class  BasicBorders.MarginBorder
    マージンをサポートするコンポーネントの周りにボーダーを描画します。
    static class  BasicBorders.MenuBarBorder
    メニュー・バーの周囲にボーダーを描画します。
    static class  BasicBorders.RadioButtonBorder
    ラジオ・ボタンの周りにボーダーを描画します。
    static class  BasicBorders.RolloverButtonBorder
    ロールオーバー・ツールバー・ボタンのための特別なthinボーダーです。
    static class  BasicBorders.SplitPaneBorder
    分割ペインの周囲にボーダーを描画します。
    static class  BasicBorders.ToggleButtonBorder
    トグル・ボタンの周りにボーダーを描画します。
    Borderとして宣言されているjavax.swing.plaf.basic内のフィールド 
    修飾子と型 フィールド 説明
    protected static Border BasicComboBoxRenderer.noFocusBorder
    空のBorder
    Borderを返すjavax.swing.plaf.basic内のメソッド 
    修飾子と型 メソッド 説明
    protected Border BasicToolBarUI.createNonRolloverBorder()
    ツールバー・コンポーネントのための非ロールオーバー・ボーダーを作成します。
    protected Border BasicToolBarUI.createRolloverBorder()
    ツールバー・コンポーネントのためのロールオーバー・ボーダーを作成します。
    Border BasicSplitPaneDivider.getBorder()
    このコンポーネントのボーダーを返します。ボーダーが現在設定されていない場合はnullを返します。
    static Border BasicBorders.getButtonBorder()
    JButtonのボーダー・インスタンスを返します。
    static Border BasicBorders.getInternalFrameBorder()
    JInternalFrameのボーダー・インスタンスを返します。
    static Border BasicBorders.getMenuBarBorder()
    JMenuBarのボーダー・インスタンスを返します。
    protected Border BasicToolBarUI.getNonRolloverBorder​(AbstractButton b)
    ボタンの非ロールオーバー・ボーダーを返します。
    static Border BasicBorders.getProgressBarBorder()
    JProgressBarのボーダー・インスタンスを返します。
    static Border BasicBorders.getRadioButtonBorder()
    JRadioButtonのボーダー・インスタンスを返します。
    protected Border BasicToolBarUI.getRolloverBorder​(AbstractButton b)
    ボタンのロールオーバー・ボーダーを返します。
    static Border BasicBorders.getSplitPaneBorder()
    JSplitPaneのボーダー・インスタンスを返します。
    static Border BasicBorders.getSplitPaneDividerBorder()
    JSplitPaneディバイダのボーダー・インスタンスを返します。
    static Border BasicBorders.getTextFieldBorder()
    JTextFieldのボーダー・インスタンスを返します。
    static Border BasicBorders.getToggleButtonBorder()
    JToggleButtonのボーダー・インスタンスを返します。
    Border型のパラメータを持つjavax.swing.plaf.basic内のメソッド 
    修飾子と型 メソッド 説明
    void BasicSplitPaneDivider.setBorder​(Border border)
    このコンポーネントのボーダーを設定します。
  • javax.swing.plaf.metalでのBorderの使用

    Borderを実装しているjavax.swing.plaf.metal内のクラス 
    修飾子と型 クラス 説明
    static class  MetalBorders.ButtonBorder
    クラスはJButtonのボーダーを表します。
    static class  MetalBorders.Flush3DBorder
    クラスは3Dボーダーを表します。
    static class  MetalBorders.InternalFrameBorder
    クラスはJInternalFrameのボーダーを表します。
    static class  MetalBorders.MenuBarBorder
    クラスはJMenuBarのボーダーを表します。
    static class  MetalBorders.MenuItemBorder
    クラスはJMenuItemのボーダーを表します。
    static class  MetalBorders.OptionDialogBorder
    クラスはオプション・ダイアログのボーダーを表します。
    static class  MetalBorders.PaletteBorder
    Paletteが使用するボーダーです。
    static class  MetalBorders.PopupMenuBorder
    クラスはJPopupMenuのボーダーを表します。
    static class  MetalBorders.RolloverButtonBorder
    クラスは、ロールオーバーButtonのボーダーを表します。
    static class  MetalBorders.ScrollPaneBorder
    クラスはJScrollPaneのボーダーを表します。
    static class  MetalBorders.TableHeaderBorder
    テーブル・ヘッダーのボーダーです。
    static class  MetalBorders.TextFieldBorder
    クラスはJTestFieldのボーダーを表します。
    static class  MetalBorders.ToggleButtonBorder  
    static class  MetalBorders.ToolBarBorder
    クラスはJToolBarのボーダーを表します。
    Borderを返すjavax.swing.plaf.metal内のメソッド 
    修飾子と型 メソッド 説明
    static Border MetalBorders.getButtonBorder()
    JButtonのボーダー・インスタンスを返します。
    static Border MetalBorders.getDesktopIconBorder()
    Desktop Iconのボーダー・インスタンスを返します。
    static Border MetalBorders.getTextBorder()
    テキスト・コンポーネントのボーダー・インスタンスを返します。
    static Border MetalBorders.getTextFieldBorder()
    JTextFieldのボーダー・インスタンスを返します。
    static Border MetalBorders.getToggleButtonBorder()
    JToggleButtonのボーダー・インスタンスを返します。
  • javax.swing.tableでのBorderの使用

    Borderとして宣言されているjavax.swing.table内のフィールド 
    修飾子と型 フィールド 説明
    protected static Border DefaultTableCellRenderer.noFocusBorder
    フォーカスのないボーダー。
  • javax.swing.treeでのBorderの使用

    Borderとして宣言されているjavax.swing.tree内のフィールド 
    修飾子と型 フィールド 説明
    protected Border DefaultTreeCellEditor.DefaultTextField.border
    使用するボーダーです。
    Borderを返すjavax.swing.tree内のメソッド 
    修飾子と型 メソッド 説明
    Border DefaultTreeCellEditor.DefaultTextField.getBorder()
    JComponent.getBorderをオーバーライドして、現在のボーダーを返します。
    Border型のパラメータを持つjavax.swing.tree内のメソッド 
    修飾子と型 メソッド 説明
    void DefaultTreeCellEditor.DefaultTextField.setBorder​(Border border)
    このコンポーネントのボーダーを設定します。
    Border型のパラメータを持つjavax.swing.tree内のコンストラクタ 
    コンストラクタ 説明
    DefaultTextField​(Border border)
    DefaultTreeCellEditor.DefaultTextFieldオブジェクトを構築します。