This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes DateField Validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "DateField Validation" Watch "DateField Validation" New topic
Author

DateField Validation

rajeshyadav mobi
Greenhorn

Joined: Apr 18, 2011
Posts: 25
Hi,
This is Rajesh
Can i do date field validation , I am using
datefield df=new DateField("", DateField.DATE);
If user doesnt select any date , it must show alert. instead of internally giving null pointer exception
Please Help me out
Thanks & Regards
Rajesh
rajeshyadav mobi
Greenhorn

Joined: Apr 18, 2011
Posts: 25
Hi,
I got a way to solve the problem,
datefield df=new DateField(",DateField.Date);
try
{
String date=df.getDate.toString();
}
catch(NullPointerException e)
{
give same alert;
AlertMsg();
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DateField Validation
 
Similar Threads
How to retrieve day in MIDlet?
j2me: Convert String to Date
Time format problem in MIDLet
DateField display variations
DateField Question