Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Date Field Midlet Example 
 

This example illustrates how to insert date field in your form.

 

Date Field MIDlet Example

                         

This example illustrates how to insert date field in your form. We are using here two fields DateField (datein and dateout) and initialize a final static variable DATE which is 0. We are taking both DateField variable in to the constructor (DateFieldExample). When application will run, first of all the startApp() method will be called and it will display the form with datein and dateout field. For the specific date we are using here java.util.Date class and java.util.TimeZone class is used to show the format of date like in figure Tue, 30 Sep, 2008

 

 

 

 

 

Application display as follows:

When <date> is selected, a new window will open with a calendar as given below.

and you can select your choice of date, month and year which will appear on the form as follows. 

 

The source code of the DateFieldExample.java is as follows:  

import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
import java.util.Date;
import java.util.TimeZone;

public class DateFieldExample extends MIDlet{
  private Form form;
  private Display display;
  private DateField datein, dateout;  
  private static final int DATE = 0;

  public DateFieldExample(){
    datein = new DateField("Date In:", DateField.DATE, TimeZone.getTimeZone("GMT"));
    dateout = new DateField("Date Out:", DateField.DATE, TimeZone.getTimeZone("GMT"));
  }

  public void startApp(){
    display = Display.getDisplay(this);
    Form form = new Form("Date Field");
    form.append(datein);
    form.append(dateout);
    display.setCurrent(form);
  }

  public void pauseApp(){
  
  }

  public void destroyApp(boolean destroy){
    notifyDestroyed();
  }
}

 

Download Source Code

                         

» View all related tutorials
Related Tags: c file list table time hash mobile object map screen hashtable maps display key value this id keys oo wav

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.