3
votes

I would like to know if there is any datefield/datepicker component for LWUIT ?

Or, will there be any work around for implement datefield in lwuit

6

6 Answers

3
votes

Other possible solution is use a LWUIT Calendar. http://lwuit.java.net/nonav/iodocs/index.html

I think it's the best solution for dates in LWUIT.

2
votes

try this

Form form = new Form("Spinners");
Spinner integerSpinner = Spinner.create(0, 1000, 100, 10);
Spinner decimalSpinner = Spinner.create(0.0, 100.0, 17.75, 0.05);
Spinner timeSpinner = Spinner.createTime(0, 24 * 60 * 60, 10 * 60 * 60, 60, true, false);
Spinner dateSpinner = Spinner.createDate(System.currentTimeMillis() - 1000 * DAY,
System.currentTimeMillis() + 1000 * DAY, System.currentTimeMillis(),
'-', Spinner.DATE_FORMAT_MM_DD_YYYY);

form.setLayout(new TableLayout(4, 2));
form.addComponent(new Label("Integer"));
form.addComponent(integerSpinner);
form.addComponent(new Label("Decimal"));
form.addComponent(decimalSpinner);
form.addComponent(new Label("Time"));
form.addComponent(timeSpinner);
form.addComponent(new Label("Date"));
form.addComponent(dateSpinner);
form.show();
2
votes

There is no DateField or DatePicker components in LWUIT. So you can use Spinner instead of DateField.

And I found one third party application for use DateField in LWUIT. They have used LWUIT and developed DateField component. But I'm not sure how it works. Let me the status if you use.

0
votes

Use the Spinner class. It has no constructor but it has static methods for creating a Spinner.

0
votes

There is also the Calendar class.

0
votes

There is some like Mobrizdatefiled in lwuit , its just using lcdui datepicker and using its functional implementation in lwuit.

LWUIT DATEFIELD