Reputation: 65
I have loaded the calendar in my LWUIT based UI. Thanks to this thread. It is neat.
when i select a certain date i want the calendar to close and the selected date to appear in my original form in dd-mmm-yyyy form.
I want to take this selected date, set the clock to 1200 hrs (afternoon) on that day and find the time in milliseconds elapsed between now and 1200 hrs on the selected date. something i have earlier asked here but for a desktop java applications using netbeans 7.1.2.
I find that methods like getInstance, getCalendar, setTime, are not supported in the LWUIT calendar. Are they? I can only have date = getDate(); but cant set the clock on that date.
Further, 1. How to select current time (now) in milliseconds. Will this work?
`Calendar today = Calendar.getInstance();
Date time_now = today.getTime();`
Whats the solution. Thanks in advance.
Upvotes: 2
Views: 599
Reputation: 52760
You are confusing the LWUIT com.sun.lwuit.Calendar
class and the java.util.Calendar
class, they have similar names but they are quite different. You can just use the java.util.Calendar
class by typing in its fully qualified name.
Keep in mind that the java.util.Calendar
class in J2ME is more limited than the one in Java SE but can still be used to some degree.
Upvotes: 2