java.lang.Object | +--com.sun.kjava.Button
ユーザインタフェースのオブジェクトとして使う単純なボタンです。 このボタンは、離したときではなく、押したときにアクションが発生します。そのため現時点では、ユーザがいったんボタンを押してしまうと、そのボタン選択を取り消すことはできません。 ビットマップボタンの周囲には、ボーダは描画されません。ボーダを付ける場合は、ビットマップにボーダを含めます。
フィールドの概要 | |
static int |
minWidth
|
コンストラクタの概要 | |
Button(Bitmap bitmap,
int x,
int y)
グラフィカルラベルの付いた Button オブジェクトを新しく生成します。 |
|
Button(java.lang.String s,
int x,
int y)
テキストラベルの付いた Button オブジェクトを新しく生成します。 |
メソッドの概要 | |
boolean |
isEnabled()
Button が使用可能かどうかを検出します。 |
void |
paint()
Button をグローバルグラフィックスコンテキストに描画します。 |
boolean |
pressed(int x,
int y)
ボタンが押されたかどうかを検出します。 |
void |
setEnabled(boolean state)
Button を使用可能 (enabled) にするかどうかを設定します。 |
void |
setText(java.lang.String s)
Button のテキストラベルを設定します。 |
クラス java.lang.Object から継承したメソッド |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
フィールドの詳細 |
public static final int minWidth
コンストラクタの詳細 |
public Button(java.lang.String s, int x, int y)
s
- ボタンのテキストラベルx
- ボタン位置の x 座標y
- ボタン位置の y 座標public Button(Bitmap bitmap, int x, int y)
s
- ボタンのグラフィカルラベルx
- ボタン位置の x 座標y
- ボタン位置の y 座標メソッドの詳細 |
public void setText(java.lang.String s)
s
- このボタンの新しいラベルpublic void setEnabled(boolean state)
state
- Button を使用可能にする場合は truepublic boolean isEnabled()
public void paint()
public boolean pressed(int x, int y)