|
||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||
Objectiappli.lib.ui.CComponent
iappli.lib.ui.CButton
public final class CButton
Canvas上に描画するボタンです。
【例】
class Test extends CostumePanel {
CButton bt = new CButton("ボタン");
public void paint(Graphics g) {
bt.show(g, 10, 10, true);
addEvent(bt);
:
}
public void processEvent2(CComponent c, int t, int p) {
if (c == bt &&
t == Display.KEY_PRESSED_EVENT &&
p == Display.KEY_SELECT) {
System.out.println("ボタンが押された");
}
}
}
| コンストラクタの概要 | |
|---|---|
CButton()
ボタンを生成します。 |
|
CButton(String text)
ボタンのラベル文字列を指定してボタンを生成します。 |
|
CButton(String text,
int c,
int s)
ボタンのラベル文字列、前景色、影付き色を指定してボタンを生成します。 |
|
| メソッドの概要 | |
|---|---|
void |
setLabel(String text)
ボタンのラベル文字列を設定します。 |
void |
show(Graphics g,
int x,
int y,
boolean b)
ボタンを描画します。 |
| クラス iappli.lib.ui.CComponent から継承されたメソッド |
|---|
clear, setBackground, setBackup, setFont, setForeground, setGraphics, setLocation, setShadow, setSize |
| クラス Object から継承されたメソッド |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| コンストラクタの詳細 |
|---|
public CButton()
public CButton(String text)
text - ボタンのラベル文字列を指定します。
public CButton(String text,
int c,
int s)
text - ラベル文字列を指定します。c - 前景色を指定します。s - 影付き色を指定します。| メソッドの詳細 |
|---|
public void setLabel(String text)
text - ボタンのラベル文字列を指定します。
null が指定された場合は空文字列("")が設定されます。
public void show(Graphics g,
int x,
int y,
boolean b)
g - キャンパスのグラフィックスオブジェクト(getGraphics())を指定します。x - 横座標(文字数)を指定します。y - 縦座標(文字数)を指定します。b - trueを指定すると描画前をバックアップします。
(ヒープメモリが取られるため使わない場合は false を指定してください。)
|
Copyright ITmarks Inc. All rights reserved. | |||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | |||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | |||||||||