Forums Register Login

Doubt from John W.Muchow -core J2ME Technology &MIDP

+Pie Number of slices to send: Send
Help me in this program. This program compiles fine but when I run in WTK22 simulator it's erroring out as

Running with storage root DefaultColorPhone
Cannot connect socket to port 2302
Windows error code 10022
Cannot open socket for LIME events on port 2302

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class CaptureItemEvents extends MIDlet implements ItemStateListener,CommandListener
{
private Display display;
private Form fmMain;
private Command cmExit;
private DateField dfDate;

public CaptureItemEvents()
{
display=Display.getDisplay(this);

dfDate=new DateField("Date is:",DateField.DATE);
dfDate.setDate(new java.util.Date());

cmExit=new Command("Exit",Command.EXIT,1);
fmMain=new Form("core J2ME");
fmMain.addCommand(cmExit);
fmMain.append(dfDate);

fmMain.setCommandListener(this);
fmMain.setItemStateListener(this);
}

public void startApp()
{
display.setCurrent(fmMain);
}

public void pauseApp()
{}
public void destroyApp(boolean unconditional){}
public void commandAction(Command c,Displayable s)
{
if(c==cmExit)
{
destroyApp(false);
notifyDestroyed();
}
}
public void itemStateChanged(Item item){
dfDate.setLabel("New Date:");
}
}
+Pie Number of slices to send: Send
hi buddy,
your code was working fine on the emulator that was provided with NetBeans 5.5

AS far as i know void itemStateChanged() works for only Items on a Form...

Though you are listening all the item state changes on the main form, lack of Item Classes will not stimulate a setLabel() on the DateField..

Please confirm my ideas on ItemStateListener interface's callback..

---------------------
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1320 times.
Similar Threads
command button not able to display need help
Converting MIDP suites to .PRC files
Please check this code !!!!
NullPointerException - Can't figure this out
exception with ImageItem
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:33:39.