Posted By:
Jisha_John
Posted On:
Monday, March 17, 2003 10:29 PM
Hello, I have got a doubt regarding the setCurrent() method. I am using the setCurrent() method under one of the commands(say editCommand) in the commandAction() method of the commandlistener. This commandListener is implemented by the Mildet A. Now, i am calling a method,(say meth()), of class B from one another command(say updateCommand) of the commandAction in A. This class B is not a midlet, but has a reference to the midlet object of A. In the meth(), i am using the setCurrent() again. My question is, the second setCurrent is not shown in the screen. why ? ************************************************************ below is the sample code: public class A
More>>
Hello,
I have got a doubt regarding the setCurrent() method.
I am using the setCurrent() method under one of the commands(say editCommand) in the commandAction() method of the commandlistener. This commandListener is implemented by the Mildet A.
Now, i am calling a method,(say meth()), of class B from one another command(say updateCommand) of the commandAction in A. This class B is not a midlet, but has a reference to the midlet object of A. In the meth(), i am using the setCurrent() again.
My question is, the second setCurrent is not shown in the screen. why ?
************************************************************
below is the sample code:
public class A extends MIDlet implements CommandListener
{
......
public void commandAction(Command c, Displayable d)
{
if (c == editCommand)
{
Form aForm = new Form("aForm");
aForm.append("Form in A");
Display.getDisplay(this).setCurrent(aForm);
}
if(c == updateCommand)
{
B bObject = new B(this);
bObject.meth();
}
}
........
}
public class B
{
......
public B(Object midlet)
{
this.midlet = midlet;
}
public void meth()
{
Form bForm = new Form("bForm");
bForm.append("Form in B");
Display.getDisplay(midlet).setCurrent(bForm);
}
}
**************************************************************
regards,
jisha
<<Less