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: 15
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

</div>
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


Terkait
Thread Thread Starter Forum Replies Last Post
Butuh programmer J2ME buat menjelaskan program J2ME PHPmaster Programming 0 20th November 2011 08:53 AM
[ASK] melink class [java j2ME] Servermaster Programming 0 20th November 2011 02:38 AM
JAVA/J2ME : Aplikasi MMS di j2me itu gimana sih??? JagoVB Programming 0 20th November 2011 12:27 AM
[UML] J2ME source code to Class Diagram. Braincode Programming 0 11th November 2011 02:10 PM
[ASK][J2ME] Memanggil fungsi berulang di J2ME Braincode Programming 0 11th November 2011 01:33 PM

 


All times are GMT +7. The time now is 12:13 PM.