You are on page 1of 2

Femin Dharamshi

BE3-26
Batch B

Shivani Darekar BE3-25


Batch B
EXPERIMENT NO. 3
Code:-
import java.util.*;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class datetime extends MIDlet
{
private Display disp;
private Date d;
private DateField currentDate;
private Form form;
private int index;

public datetime(){
form = new Form("Data and Time");
d = new Date();
currentDate = new DateField("", DateField.DATE_TIME,TimeZone.getTimeZone("IST"));
currentDate.setDate(d);
}

public void startApp(){


index = form.append(currentDate);
disp = Display.getDisplay(this);
disp.setCurrent(form);
}
protected void pauseApp() {}
protected void destroyApp(boolean unconditional) {}
}
Output:-

You might also like