This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm currently working on my Java ME assignment and got stuck on question relating to the datefield. The question is as follows:
"Include a DateField that shows the date one day in the future from the current date/time and display both the date and time, taking into account the current time zone of the device (see the TimeZone class). The user should be able to click on the date or the time and modify it."
Below is my code stripped down to the question I'm having problems with:
private long longModedTime;
private Date dateModed;
private DateField dateFieldFutureDate;
longModedTime = dateModed.getTime();
//86400000 is one day in milliseconds.
longModedTime += 86400000;
dateFieldFutureDate = new DateField("DateField showing one day in advance", DateField.DATE , TimeZone.getDefault());
I can't seem to figure out how to pass that date object into the datefield. The datefield object only accepts (String, Iinteger, TimeZone) or (String, Int) but I have to include the TimeZone as assignment specs.
Please help, this is the last question in my assignment and I wanna get it outta the way.
Thanks in advance.