HI, I am beginner in j2me. Trying to store the data[array] into next form. It will be helpful if you provide edit and delete the
records from the form2. Can you suggest easier way to store the values in j2me
import java.io.*;
import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class InputArray extends MIDlet implements CommandListener {
private Form form1, form2;
private Command exit,next;
private DateField df;
private TextField tf;
// private char data[][] = {'a', 'b', 'c'}};
private String str[] = {"111"};
public InputArray() {
form1 = new Form("Main Menu");
df = new DateField("Choose a Date", DateField.DATE_TIME);
df.setDate(new java.util.Date());
tf = new TextField("Post a Note", "", 32, TextField.ANY);
// First Form
form1.append(df);
form1.append(tf);
// Second form
exit = new Command("Exit", Command.EXIT, 0);
next = new Command("ADD", Command.SCREEN, 1);
form1.addCommand(next);
form1.addCommand(exit);
form2 = new Form("Second Form");
form2.addCommand(exit);
}
public void startApp() {
form1.setCommandListener(this);
form2.setCommandListener(this);
Display.getDisplay(this).setCurrent(form1);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
if(c == exit) notifyDestroyed();
else if (c == next)
{
StringItem tmp = new StringItem(null, ("bla" + (str(buffer) )));
StringItem tmp = new StringItem(null, "bla " + (str(buffer)));
form2.append(tmp);
// form2.append(new StringItem("", tmp));
// form2.append(new StringItem(null, "Store the values Date and Text"));
Display.getDisplay(this).setCurrent(form2);
}
}
}