FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

null pointer exception

 
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users
View previous topic :: View next topic  
Author Message
kelvin



Joined: 15 Jul 2009
Posts: 1

PostPosted: Wed Jul 15, 2009 3:03 pm    Post subject: null pointer exception Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java ME Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB