gan ane mw tanya nih,
Code:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/*
class login implements CommandListener {
//another form
private Form framelogin;
private Command back;
tes5 tes;
public login()
{
TextField user = new TextField("Username :","",4,TextField.ANY);
TextField pass = new TextField("Password :","",4,TextField.PASSWORD);
back = new Command("balik",Command.BACK,1);
framelogin.addCommand(back);
framelogin.append(user);
framelogin.append(pass);
framelogin.setCommandListener(this);
}
public void commandAction(Command arg0, Displayable arg1) {
// TODO Auto-generated method stub
if(arg0==back)
{
tes.back();
}
}
}
*/
public class tes5 extends MIDlet implements CommandListener
{
Command keluar,lain;
private Form utama;
private Display display;
Alert alert;
// login inih = new login();
//construct
public tes5(){
keluar = new Command("Klwar", Command.EXIT, 9);
lain = new Command("lain",Command.OK,9);
utama = new Form("Haii");
utama.addCommand(keluar);
utama.addCommand(lain);
utama.setCommandListener(this);
}
public void back()
{
display.setCurrent(utama);
}
public void startApp(){
display = Display.getDisplay(this);
display.setCurrent(utama);
}
TextField box;
public void waka()
{
box = new TextField("tesz", "www", 4, TextField.PASSWORD);
utama.append(box);
}
public void pauseApp(){
}
public void destroyApp(boolean arg){
}
public void commandAction(Command c, Displayable d){
if(c==keluar)
{
notifyDestroyed();
}
else if(c==lain)
{
utama.append("lol");
// display.setCurrent(login);
}
}
}
itu kan klo ane run pasti jalan,
trus pas ane update jadi
Code:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
class login implements CommandListener {
//another form
private Form framelogin;
private Command back;
tes5 tes;
public login()
{
TextField user = new TextField("Username :","",4,TextField.ANY);
TextField pass = new TextField("Password :","",4,TextField.PASSWORD);
back = new Command("balik",Command.BACK,1);
framelogin.addCommand(back);
framelogin.append(user);
framelogin.append(pass);
framelogin.setCommandListener(this);
}
public void commandAction(Command arg0, Displayable arg1) {
// TODO Auto-generated method stub
if(arg0==back)
{
tes.back();
}
}
}
public class tes5 extends MIDlet implements CommandListener
{
Command keluar,lain;
private Form utama;
private Display display;
Alert alert;
login inih = new login();
//construct
public tes5(){
keluar = new Command("Klwar", Command.EXIT, 9);
lain = new Command("lain",Command.OK,9);
utama = new Form("Haii");
utama.addCommand(keluar);
utama.addCommand(lain);
utama.setCommandListener(this);
}
public void back()
{
display.setCurrent(utama);
}
public void startApp(){
display = Display.getDisplay(this);
display.setCurrent(utama);
}
TextField box;
public void waka()
{
box = new TextField("waka", "zzz", 4, TextField.PASSWORD);
utama.append(box);
}
public void pauseApp(){
}
public void destroyApp(boolean arg){
}
public void commandAction(Command c, Displayable d){
if(c==keluar)
{
notifyDestroyed();
}
else if(c==lain)
{
utama.append("lol");
display.setCurrent(login);
}
}
}
kenapa ga jalan ya, mohon pencerahnnya