Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Servermaster Servermaster is offline
Member Aktif
 
Join Date: Nov 2011
Posts: 257
Rep Power: 14
Servermaster mempunyai hidup yang Normal
Default [error] belajar class di j2me ..

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



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 12:39 AM.


no new posts