Hello. First of all, I'm not an experienced Java programmer, I've only studied it for one semester one year ago.

This year I received a project called "Secure SMS messaging using J2ME". Because I'm not familiar with the J2ME (ME SDK 3.0, the version that I have) I started looking for simple tutorials to see how it works. But unfortunately I got stuck at some of the most simple tutorials out there.

I was trying some examples that are supposed to show me the date or the time on the phone screen, but I don't seem to know how to make them work.

I'm talking about the example from here:

Java Code:
import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class NewClass extends MIDlet implements CommandListener{
  private Display disp;
  private Date d;
  Calendar c = Calendar.getInstance();
  String time;
  private DateField currentDate;
  private Command start, exit;
  private Form form;
  private int index;

  public NewClass(){
    form = new Form("Data and Time");
    d = new Date();
    start = new Command("start", Command.SCREEN, 1);
    exit = new Command("Exit", Command.EXIT, 0);
    currentDate = new DateField("", DateField.DATE_TIME);

  public void startApp(){
    form.append("CURRENT TIME IS: ");
    index = form.append(currentDate);
    disp = Display.getDisplay(this);

  public void pauseApp(){}

  public void destroyApp(boolean uncond){}

  public void commandAction(Command cmd, Displayable s){
    if (cmd == exit){
    }else if (cmd == start){
      d = new Date();
      time = c.get(Calendar.HOUR_OF_DAY) + ":" +c.get(Calendar.MINUTE)
              + ":" + c.get(Calendar.SECOND);
      form.append("" + time);

All I get after compiling it is this and then this. Can anybody explain what I'm doing wrong?
Thank you.