×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Cannot select date LWUIT Calender??

    Hi Everyone !!

    I am not able to select the date in LWUIT calendar. I used getSelectDay() method which gives the long value.
    Here is my code :
    PHP Code:
    public class ViewCalender extends Form implements ActionListenerDataChangedListener {

        
    Command cmd_ok;
        
    Calendar cal;
        static final 
    int CMD_GETDATE 0;

        public 
    ViewCalender() {
        }

        
    void showCalender() {
            
    cal = new Calendar();
            
    cmd_ok = new Command("Get Date"CMD_GETDATE);
            
    this.setTitle("Select Date");
            
    this.addCommand(cmd_ok);
            
    this.setCommandListener(this);
            
    this.addComponent(cal);
            
    this.show();
        }

        public 
    void dataChanged(int typeint index) {
            switch(
    type){
                case 
    ADDED:
                    break;
                case 
    CHANGED:
                    
    Component cmpnt cal.getComponentAt(index);
                    break;
                case 
    REMOVED:
                    break;
                default:
                    break;
            }
        }

        public 
    void actionPerformed(ActionEvent ae) {
            
    int cmd_id ae.getCommand().getId();

            switch (
    cmd_id) {
                case 
    CMD_GETDATE:
                    
    long l cal.getSelectedDay();
                    
    Date tempdate = new Date(l);
                    
    java.util.Calendar c java.util.Calendar.getInstance();
                    
    c.setTime(tempdate);
                    
    int m c.get(java.util.Calendar.MONTH);
                    
    int d c.get(java.util.Calendar.DAY_OF_MONTH);
                    
    int y c.get(java.util.Calendar.YEAR);
                    
    MyDialog.showCustomDLG("Message""Current date : "+m+"-"+d+"-"+yDialog.TYPE_INFO);
    //                cal.setCurrentDate(date);
    //                date = cal.getDate();

                    
                    
    break;
                default:
                    break;
            }
        }

    How can i select the date let current date is : 14-02-2011 . How would i select the date as 16-02-*2011. And set this to textfield.

    Please Reply
    Regards
    Rajan Verma

  2. #2
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Re: Cannot select date LWUIT Calender??

    sorry to distub, i resolve my issue ..
    Regards
    Rajan Verma

  3. #3
    Regular Contributor
    Join Date
    Dec 2009
    Location
    Ghaziabad
    Posts
    244

    Question Re: Cannot select date LWUIT Calendar??

    Can we have Calendar Field in LWUIT as like textfiled
    Regards
    Rajan Verma

Similar Threads

  1. Date field in Lwuit textfields
    By arvind kumar yadav in forum Mobile Java General
    Replies: 7
    Last Post: 2011-08-22, 13:02
  2. Changes in lwuit w.r t date
    By kumarv75 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-12-04, 08:33
  3. Select date sql query comparision.....
    By kalgi in forum Symbian
    Replies: 2
    Last Post: 2009-09-09, 06:20
  4. database of select date problem
    By mingkit in forum Symbian
    Replies: 2
    Last Post: 2003-09-06, 14:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×