kkasasuke
narutoo
sasuke
diadara
kata acak
pemrograman java mobile "data"
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class TextFieldForm extends MIDlet implements CommandListener {
private Form form1, form2;
private Command ok;
private TextField nama, alamat, email,telepon, password;
public void startApp(){
nama = new TextField("Nama: ", "", 30, TextField.ANY);
alamat = new TextField("Alamat: ", "",30, TextField.ANY);
email = new TextField("email: ", "",30, TextField.EMAILADDR);
telepon = new TextField("Telepon: ", "",30, TextField.PHONENUMBER);
password = new TextField("Password: ", "",30, TextField.PASSWORD | TextField.ANY);
ok = new Command("OK", Command.OK,1);
form1 = new Form("Form Input");
form1.addCommand(ok);
form1.append(nama);
form1.append(alamat);
form1.append(email);
form1.append(telepon);
form1.append(password);
form1.setCommandListener(this);
Display.getDisplay(this).setCurrent(form1);
}
public void pauseApp() {}
public void destroyApp(boolean destroy) {}
public void commandAction(Command c, Displayable d) {
if (c == ok) {
showInput();
}
}
public void showInput () {
form2 = new Form("Nilai Input");
String n = nama.getString();
String a = alamat.getString();
String b = email.getString();
String c = telepon.getString();
String d = password.getString();
form2.append(n);
form2.append(a);
form2.append(b);
form2.append(c);
form2.append(d);
Display.getDisplay(this).setCurrent(form2);
}
}
bergabunglah disini:
unisbank.ac.id
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar