1

I am a new in the J2ME. I have searched a lot on the J2ME tutorial, but I did not find an answer. I am using the calendar component in LWUIT 1.4 and I want to set the selected date of the calendar into the textfield. I also used this link. But it did not work, it only shows the calendar and the getDate() function did not work in the LWUIT 1.4. Please suggest any better books or tutorials for the J2ME with LWUIT 1.4. here is my code:

txtDOB.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent arg0) {
           // throw new UnsupportedOperationException("Not supported yet.");

             final Form calFrame = new Form();
                final Calendar cal = new Calendar();
                calFrame.setScrollable(true);
                calFrame.setSmoothScrolling(true);
                calFrame.setIsScrollVisible(true);
                cal.addDataChangeListener(new DataChangedListener() {

                public void dataChanged(int arg0, int arg1) {
                txtDOB.setText(cal.getDate());  //textfield which was shown error of unknown symbole.
                        ffregs.showBack();
                }
            });

                calFrame.addComponent(cal);
                calFrame.show();


        }
4

2 回答 2

1

Codename One 博客中有很多教程,LWUIT 的好处是你可以在谷歌中输入任何问题,你会得到很多结果。

日历组件有一些限制,据我回忆,这些限制在 1.5 中已修复。但是,无论如何,现在大部分开发工作都在Codename One中进行。

于 2012-04-08T12:11:00.087 回答
0

你的问题到底是什么?你能显示一些代码吗?我认为如果您可以将整个问题分解为一小段代码,您会发现您的问题会产生更成功的答案。并显示该代码。

话虽如此,我已经看到了一个很好的 LWUIT 教程。 看一看。

这很容易成为我发现甚至听说过的最佳参考。如果您需要更多建议而不仅仅是一个链接,请发布更多代码。

于 2012-04-08T06:58:04.547 回答