I have the following TextItem
:
final TextItem txtFromAmt = new TextItem();
txtFromAmt.setWrapTitle(false);
txtFromAmt.setShowTitle(false);
txtFromAmt.setAlign(Alignment.LEFT);
txtFromAmt.setWidth(100);
I want this TextItem
to only allow numbers. How can I do that? Is there any property/method of TextItem
to do that?
Please check the below documentation.
As suggested by El Hoss try the same
txtFromAmt.setKeyPressFilter("[0-9.]"); // allows only digits and .(dot)