i tried to show the calendar on button click using form but i’m unable to change the date and very much struggled to find where the focus .
...
Button mdate=new Button("change date");
mdate.addActionListener(this);
...
public void actionPerformed(ActionEvent ae) {
Form cal= new Form();
com.sun.lwuit.Calendar c =new com.sun.lwuit.Calendar();
c.setFocus(true);
c.addActionListener(this);
cal.addComponent(c);
cal.show();
}
how to show and hide calendar on button click in a better way
Better you can use
Dialog(like pop up) instead of Form. You can easily dispose within aForm. No need to show another form. See the below sample code,And add the selected and unselected style for
CalendarlikeCalendarSelectedDay,CalendarDate. Also add the selected and unselected style forComboBox.