モジュール java.desktop
パッケージ javax.swing

インタフェースIcon

既知のすべてのサブインタフェース:
SynthIcon
既知のすべての実装クラス:
IconUIResource, ImageIcon, MetalCheckBoxIcon, MetalComboBoxIcon, MetalIconFactory.FileIcon16, MetalIconFactory.FolderIcon16, MetalIconFactory.PaletteCloseIcon, MetalIconFactory.TreeControlIcon, MetalIconFactory.TreeFolderIcon, MetalIconFactory.TreeLeafIcon

public interface Icon
通常はコンポーネントを装飾するために使う、固定サイズの小型イメージです。
導入されたバージョン:
1.2
関連項目:
  • メソッドのサマリー

    修飾子と型
    メソッド
    説明
    int
    アイコンの高さを返します。
    int
    アイコンの幅を返します。
    void
    paintIcon(Component c, Graphics g, int x, int y)
    指定された位置にアイコンを描画します。
  • メソッドの詳細

    • paintIcon

      void paintIcon(Component c, Graphics g, int x, int y)
      指定された位置にアイコンを描画します。 Iconの実装はコンポーネント引数を使って、フォアグラウンド・カラーまたはバックグラウンド・カラーなどを描画するのに使用するプロパティを取得できます。
      パラメータ:
      c - ペイントに便利なプロパティを取得するComponent
      g - グラフィックス・コンテキスト
      x - アイコンの左上隅のX座標
      y - アイコンの左上隅のY座標
    • getIconWidth

      int getIconWidth()
      アイコンの幅を返します。
      戻り値:
      アイコンの固定の幅を指定するint値
    • getIconHeight

      int getIconHeight()
      アイコンの高さを返します。
      戻り値:
      アイコンの固定の高さを指定するint値