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


        }
Community
  • 1
  • 1
Kirti
  • 9
  • 4

2 Answers2

1

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.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65
0

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.

john_science
  • 6,325
  • 6
  • 43
  • 60
  • 1
    That is a REALLY old tutorial, half of the stuff there is no longer relevant. – Shai Almog Apr 08 '12 at 12:08
  • but the getDate() function shows the error of unknown symbole means it is not a part of lwuit import. thats my problem and now i did not got answer how to set the date in the textfield. – Kirti Apr 09 '12 at 07:04
  • sir sorry i m did not able to upload the code but i used the same code as shown in this link http://stackoverflow.com/questions/6148862/how-to-add-calendar-in-lwuit-textfield-or-combobox. but my only problem is that the getDate function was not supported to lwuit import it was shown the error of unknown symbole. – Kirti Apr 09 '12 at 07:13