LWUIT 中的 TextField 约束

发布于 2024-11-19 20:22:17 字数 437 浏览 4 评论 0原文

  1. 我想在我的 j2me 应用程序中使用文本字段,其中想要给出 限制用户只能输入 4 位数字数据?怎么可以 有可能。

    我用过这个:-TxtField1.setConstraint(TextField.NUMERIC); 使我的文本字段为数字,但不能有输入 4 的约束 仅数字!

  2. 我想在 LWUIT 中使用 Sprite 类。

因为我想制作时钟定时器类型的应用程序。当用户在文本字段中输入时间(如(10,7,3 等..) 然后按“确定”用户可以看到屏幕下方的数字移动 0,1,2...等。现在我拍摄了 0-9 数字的图像以便更好地查看。现在我想在运行时更改该图像。

意思是当数字达到25时。然后我必须拍摄数字2和5的图像 为此,我想要精灵,

还有其他方法可以做到这一点吗?

有人可以帮我吗? 提前致谢

  1. I want to use textfield in my j2me application where in want to give
    constraint that user can enter 4digit numeric data only?? How can it
    be possible.

    i had used this:-TxtField1.setConstraint(TextField.NUMERIC); Which
    makes my textfield numeric but can't had constraint which enter 4
    digits only!

  2. I want to use Sprite class in LWUIT.

As i want to make clock timer type of application.That when user enter the time in textfield like (10,7,3 etc..)
and press ok User can see the number below the screen moving 0,1,2....etc.Now i had taker the image of 0-9 number to give a better look.Now i want to change that image at run time.

Means when the number comes 25.Then i have to take the image of number 2 and 5
For this purpose i want sprite

Is there any other way i can do this!!

Can anyone please help me for this?
Thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冷了相思 2024-11-26 20:22:17

使用固定在中心的图像列表并设置选定的索引。您还可以使用带有图像的标签并使用 Container.replace() ,它允许您为替换操作分配转换。

LWUIT 中不需要精灵。

Use a list of images fixed to the center and set selected index. You can also use a label with an image and use Container.replace() which allows you to assign a transition for the replace operation.

There is no need for sprites in LWUIT.

抱猫软卧 2024-11-26 20:22:17

使用 setMaxSize(4) 仅限制 4 位数字。 AFAIK 你不能将 sprite 与 LWUIT 一起使用。为什么要将 Sprite 与 LWUIT 一起使用?

Use setMaxSize(4) for limit the 4 digits only. AFAIK you can't use sprite with LWUIT. Why you want use Sprite with LWUIT?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文