DateField(String label, int mode) : DateField « javax.microedition.lcdui « Java by API






DateField(String label, int mode)

 

import java.util.Calendar;

import javax.microedition.lcdui.DateField;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;

public class DateFieldTIME extends MIDlet {
  protected Display display;

  protected void startApp() {
    display = Display.getDisplay(this);

    Form form = new Form("Demo");

    form.append("line");

    DateField timeOnly = new DateField("Time", DateField.TIME);
    timeOnly.setDate(Calendar.getInstance().getTime());
    form.append(timeOnly);

    display.setCurrent(form);
  }

  protected void pauseApp() {
  }

  protected void destroyApp(boolean unconditional) {
  }
}

   
  








Related examples in the same category

1.DateField.DATE_TIME
2.DateField.TIME