Java

Moderators: zibadian
Number of threads: 7818
Number of posts: 18218

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
null pointer exception Posted by kelvinnera on 15 Jul 2009 at 8:18 AM
hello....
now i'm making j2me bluetooth application, and i get the problem when i want input data in handpone appication i get statement null pointer exception....

i not understand what this problem....
anyone can help me....
this coding libraryclient, that application tell null pointer exception...
thanks...

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;

public LibraryClient() {
menu.addCommand( KELUAR_CMD );
menu.addCommand( OK_CMD );
menu.setCommandListener( this );}

public void startApp() {
show( null );}

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;}
}



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.