Ganesh
Ganesh

Reputation: 179

Datefield in LWUIT?

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

Upvotes: 3

Views: 1011

Answers (6)

bharath
bharath

Reputation: 14453

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.

Upvotes: 2

Vijay YD
Vijay YD

Reputation: 534

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

LWUIT DATEFIELD

Upvotes: 0

user806574
user806574

Reputation:

There is also the Calendar class.

Upvotes: 0

frayab
frayab

Reputation: 2512

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.

Upvotes: 3

Lucifer
Lucifer

Reputation: 29642

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();

Upvotes: 2

pheromix
pheromix

Reputation: 19307

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

Upvotes: 0

Related Questions