BlackBerry Forums Support Community
              

Closed Thread
 
LinkBack Thread Tools
Old 05-20-2008, 08:48 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: May 2008
Model: 7100
PIN: N/A
Carrier: Sprint
Posts: 31
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default java.lang.NoClassDefFoundError: net/rim/device/api/system/KeyListener

Please Login to Remove!

hi,
iam trying to mix up the midlet and RIM APi`s together but i am getting the following error when i use KeyListener.
java.lang.NoClassDefFoundError: NewBuild: net/rim/device/api/system/KeyListener
at com.sun.midp.midlet.MIDletState.createMIDlet(+14)
at com.sun.midp.midlet.Scheduler.schedule(+52)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+116)

iam pasting my code for the reference

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeExcepti on;

import net.rim.device.api.system.Application;
import net.rim.device.api.system.KeyListener;


public class NewBuild extends MIDlet implements KeyListener{
MyCanvas canvas;
Display display;
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {


}

protected void pauseApp() {

}

protected void startApp() throws MIDletStateChangeException {
Application.getApplication().addKeyListener(this);
display=Display.getDisplay(this);
this.canvas=new MyCanvas();
display.setCurrent(canvas);
}

public boolean keyChar(char arg0, int arg1, int arg2) {

return false;
}

public boolean keyDown(int arg0, int arg1) {

return false;
}

public boolean keyRepeat(int arg0, int arg1) {

return false;
}

public boolean keyStatus(int arg0, int arg1) {

return false;
}

public boolean keyUp(int arg0, int arg1) {

return false;
}

}


import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
public class MyCanvas extends Canvas{

protected void paint(Graphics g) {
g.setColor(255,255,255);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(0,0,0);
g.drawString("Hello J2me", 0, 0, 0);

}

}

Can any one help me to come out of this??

Thanks
ajj
Offline  
Closed Thread


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

HM4-65664AB-9 8Kx8 gold static ram MHS HM-65664-AB-9 PLCC32 ultimate CMOS SRAM
$40.97
HM4-65664AB-9 8Kx8 gold static ram MHS HM-65664-AB-9 PLCC32 ultimate CMOS SRAM picturePos 1GB DDR2 667 CL5 RAM Memory PC2-5300S-555-12-A0 Ici MT8HTF12864HDY-667E1
$9.67
Pos 1GB DDR2 667 CL5 RAM Memory PC2-5300S-555-12-A0 Ici MT8HTF12864HDY-667E1 pictureGeneral Pipe Cleaners Kinetic Water Ram Drain Cleaning Tool with Accessories
$289.99
General Pipe Cleaners Kinetic Water Ram Drain Cleaning Tool with Accessories pictureNew Driver Side Window Door Switch Lock Bezel For 02-05 Dodge Ram 1500 LFSZ01
$15.32
New Driver Side Window Door Switch Lock Bezel For 02-05 Dodge Ram 1500 LFSZ01 pictureGreenlee 7310SB Ram and Hand Pump Hydraulic Driver Kit with 10 Slug Buster
$1890.02
Greenlee 7310SB Ram and Hand Pump Hydraulic Driver Kit with 10 Slug Buster picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.