Label クラス
- [内容]
- 文字列を表示するためのクラスです
- [主な変数]
- public static final int CENTER
- 中央を示す
- public static final int LEFT
- 左を示す
- public static final int RIGHT
- 右を示す
- [コンストラクタ]
- public Label()
- public Label(String text)
- public Label(String text, int alignment)
- Label オブジェクトを生成する.水平方向の位置( alignment )は,LEFT,CENTER,または,RIGHT から選択する.
- [主なメソッド]
- public Graphics getGraphics() ( Component から継承)
- このコンポーネントのグラフィックスコンテキストを作成する.コンポーネントが現在表示可能でない場合は,null を返す.(参照: TextArea クラス)
- public void paint(Graphics g) ( Component から継承)
- 描画
- public void paintAll(Graphics g) ( Component から継承)
- このコンポーネントおよびそのすべてのサブコンポーネントを描画
- public void repaint() ( Component から継承)
- public void repaint(int x, int y, int width, int height) ( Component から継承)
- public void repaint(long tm) ( Component から継承)
- public void repaint(long tm, int x, int y, int width, int height) ( Component から継承)
- 指定された矩形領域を,tm ミリ秒以内に再描画する
- public void setBackground(Color c) ( Component から継承)
- バックグラウンドカラーを設定する
- public void setFont(Font f) ( Component から継承)
- フォントを設定する
- public void setForeground(Color c) ( Component から継承)
- フォアグラウンドカラーを設定する
- public void setText(String text)
- テキストを設定する
- public void setVisible(boolean b) ( Component から継承)
- コンポーネントを表示,非表示にする
- [使用例]
- プログラム例は,Label クラスの各メソッド等の使用例です.大きさの違う 2 つのラベルが貼り付けてあります.

- [参照]
- JLabel