| View previous topic :: View next topic |
| Author |
Message |
kelvin
Joined: 15 Jul 2009 Posts: 1
|
Posted: Wed Jul 15, 2009 3:03 pm Post subject: null pointer exception |
|
|
hello, i need some help...
now i made j2me application with bluetooth, and i have a problem, when i want input data in handphone application i get null pointer exception statement, this program can be execute and no error, i not understand what this problem....
please help me, i give this code is follow :
import javax.microedition.midlet.MIDlet;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.*;
import java.io.*;
public final class LibraryClient extends MIDlet implements CommandListener {
static final int ALERT_TIMEOUT = 2000;
private final Command KELUAR_CMD = new Command("Keluar",Command.EXIT,1 );
private final Command OK_CMD = new Command( "Masuk", Command.SCREEN, 2 );
private final Form menu = new Form( "Bluetooth Library" );
private LibraryGUI LibraryBTClient = null;
private Alert a;
public LibraryClient() {
menu.addCommand( KELUAR_CMD );
menu.addCommand( OK_CMD );
menu.setCommandListener( this );
a = null;
}
public void startApp() {
show( a );}
public void pauseApp() {}
public void destroyApp( boolean unconditional ) {
if ( LibraryBTClient != null ) {
LibraryBTClient.destroy();}}
public void commandAction( Command c, Displayable d ) {
if ( c == KELUAR_CMD ){
destroyApp( true );
notifyDestroyed();}
if ( c == OK_CMD ){
LibraryBTClient = new LibraryGUI( this );}}
void show( Alert a ) {
if ( a == null ){
Display.getDisplay(this).setCurrent(menu);}
else{
Display.getDisplay(this).setCurrent( a, menu );}}
Displayable getDisplayable(){
return menu;}
}
thanks... |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|