permaculture playing cards
The moose likes Java Micro Edition and the fly likes Doubt from John W.Muchow -core J2ME Technology &MIDP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Doubt from John W.Muchow -core J2ME Technology &MIDP" Watch "Doubt from John W.Muchow -core J2ME Technology &MIDP" New topic

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

Meena kumar

Joined: Dec 13, 2006
Posts: 3
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()

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");


public void startApp()

public void pauseApp()
public void destroyApp(boolean unconditional){}
public void commandAction(Command c,Displayable s)
public void itemStateChanged(Item item){
dfDate.setLabel("New Date:");
Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
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..


Theepan Thevathasan
SCJP 1.4, SCWCD 1.4, SCMAD 1.0 SCBCD 1.3, MCP(.Net Frm 2.0 App Dev Fdn)
I agree. Here's the link:
subject: Doubt from John W.Muchow -core J2ME Technology &MIDP
jQuery in Action, 3rd edition