【Java】EZアプリ勉強しつつ作っていく

このエントリーをはてなブックマークに追加
331
sage忘れた。
>>32は、Old.javaってファイルで本体。
一応、>>1の本のテキストフィールドをパクってます。

で、Huzoku.javaのその1。
〜〜〜〜〜〜〜〜〜〜〜

import javax.microedition.lcdui.*;

class Huzoku extends Form implements CommandListener{
privateTextFieldtextField0; //テキストフィールド1(生まれ西暦)
privateTextFieldtextField1; //テキストフィールド2(生まれ月)
privateTextFieldtextField2; //テキストフィールド3(生まれ日)
privateCommandsoft1; //ソフトキー1
341:04/02/01 02:06 ID:3I8BRvdO
Huzoku.java その2
Huzoku(){
super("年齢計算");
textField0=new TextField("生まれ西暦","",30,TextField.NUMERIC);
append(textField0);
textField1=new TextField("生まれ月","",30,TextField.NUMERIC);
append(textField1);
textField2=new TextField("生まれ日","",30,TextField.NUMERIC);
append(textField2);
soft1=new Command("チェック",Command.SCREEN,1);
addCommand(soft1);
setCommandListener(this);
}
351:04/02/01 02:07 ID:3I8BRvdO
Huzoku.java その3

/**コマンドイベント**/
public void commandAction(Command c,Displayable s){

if (c==soft1) {
Alert alert=new Alert("DIALOG","あなたは"+textField0.getString()+"/"+textField1.getString()+"/"+textField2.getString()+"生まれですね。",null,AlertType.INFO);
alert.setTimeout(Alert.FOREVER);
(Display.getDisplay(OldEx.current)).setCurrent(alert);
}
}
}