0

i am developing an application to view the calender in a form and the calander is displaying in screen. But not highlight the selection, the code i used is as follows please help me

final Dialog dialogue = new Dialog();
                calendar = new Calendar();
                calendar.setFocus(true);
                /*calendar.setFocusable(true);
                calendar.setEnabled(true);*/
                calendar.setSelectedStyle(getSelectedStyle());

                calendar.getStyle().setBgColor(0xff0000);
                calendar.getStyle().setFont(FontUtils.PROPORTIONAL_FONT_PLAIN_SMALL);

                calendar.setMonthViewSelectedStyle(getSelectedStyle());
                calendar.setMonthViewUnSelectedStyle(getUnselectedStyle());

                calendar.getUnselectedStyle().setFont(FontUtils.PROPORTIONAL_FONT_PLAIN_SMALL);
                calendar.getSelectedStyle().setFont(FontUtils.PROPORTIONAL_FONT_BOLD_MEDIUM);
                calendar.getPressedStyle().setFont(FontUtils.PROPORTIONAL_FONT_BOLD_MEDIUM);
                calendar.getSelectedStyle().setFgColor(0xff0000);
                calendar.getPressedStyle().setFgColor(0xff0000);
                calendar.setUnselectedStyle(getSelectedStyle());
                dialogue.addComponent(calendar);
                dialogue.addCommand(new Command("Cancel") {

                    public void actionPerformed(ActionEvent evt) {
                        dialogue.dispose();
                    }
                });
                calendar.addFocusListener(new FocusListener() {

                    public void focusLost(Component paramComponent) {
                        // TODO Auto-generated method stub

                    }

                    public void focusGained(Component paramComponent) {
                        // TODO Auto-generated method stub
                        paramComponent.getSelectedStyle().setFgColor(0xff0000);
                        paramComponent.getPressedStyle().setFgColor(0xff0000);
                    }
                });
                calendar.addActionListener(new ActionListener() {

                    public void actionPerformed(ActionEvent ae) {
                        btnbirthday.setText(null);
                        btnbirthday.setText(formatingCalenderText(calendar.getDate().toString()));
                        dialogue.dispose();
                    }
                });

thanks and regards Pranav

pranavjayadev
  • 937
  • 7
  • 31

1 Answers1

1

Try to use these UIID to change the style of this Component.. CalendarDay, CalendarNavigation and CAlendarDay

Mun0n
  • 4,438
  • 4
  • 28
  • 46