1
votes

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


        }
2

2 Answers

1
votes

There are lots of tutorials in the Codename One blog the nice thing about LWUIT is that you can just type any question into Google and you will get plenty of results.

The calendar component had some limitations which were fixed in 1.5 as far as I recall. However, most of the development is now going on in Codename One anyway.

0
votes

What is your problem, exactly? Can you show some code? I think you'll find your questions yield much more successful answers if you can break your whole question down to a short piece of code. And show that code.

That being said, I have seen a nice tutorial for LWUIT. Take a look.

That is easily the best reference I've found, or even heard of. Please post more code if you want more advice than just the one link.