He He He Udah lama g nulis lagi, maklum lagi sibuk (waduh kayak pejabat ae)🙂 . ah udah ah g usah lama lama langsung ae.

sebenere q juga baru belajar bahasa java maklum karena terpaksa sih ngerjain TA.

untuk kali nie q pengen buat aplikasi Java Mobile untuk pengecekan password.

nah sintak nya kayak gini >>>>>>

**
* @author gemix@wordpress.com
*/
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.*;
public class login extends MIDlet implements CommandListener {
private Display display;
private TextField userName;
private TextField password;
private Form form;
private Command cancel;
private Command login;
public login() {
userName = new TextField("LoginID  :", "", 10, TextField.ANY);
password = new TextField("Password :", "", 10, TextField.PASSWORD);
form = new Form("Login");
cancel = new Command("Cancel", Command.CANCEL, 2);
login = new Command("Login", Command.OK, 2);
}
public void startApp() {
form.setTitle("Silakan Login");
form.append(userName);
form.append(password);
form.addCommand(cancel);
form.addCommand(login);
form.setCommandListener(this);
display.setCurrent(form);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
notifyDestroyed();
}
public void validateUser(String name, String password) {
if (name.equals("usernya") && password.equals("passwordnya")) {
bener();
} else {
tryAgain();
}
}
public void bener() {
Alert benar = new Alert("Login Sukses", "Selamat Login Sukses", null, AlertType.ERROR);
error.setTimeout(Alert.FOREVER);
display.setCurrent(error);
}
public void tryAgain() {
Alert salah = new Alert("Login salah", "Silakan Ulangi lagi", null, AlertType.ERROR);
salah.setTimeout(Alert.FOREVER);
userName.setString("");
password.setString("");
display.setCurrent(salah, form);
}
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("Cancel")) {
destroyApp(true);
} else if(label.equals("Login")) {
validateUser(userName.getString(), password.getString());
}
}
}