codename one日历视图无法更改当前日期的文本

nkcskrwz  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(253)

我已经扩展了一个代号为日历,但是,似乎我不能更新文本天在当前的月份,但我可以很容易地更新日期之前或之后出现的选定的月份
下面的图片显示我把其他日子改成了字母“f”:

你知道我在哪里错过了吗,因为我什么都试过了!我正在使用netbeans,还使用“chrome”示例来测试我的案例。

protected com.codename1.ui.Calendar gui_Calendar = new com.codename1.ui.Calendar(){
    @Override protected void setDayText(Component c, String t){
        System.err.println(c+" | "+t);
        super.setDayText(c, "H");
        Button b=(Button)c;
        b.setText("F");
    }
    protected void setDayUIID(Component cmp, String uiid){
    //   System.err.println(cmp+" | "+uiid);
        super.setDayUIID(cmp, uiid);

    }
    @Override protected Component createDayComponent(){
        Component c = super.createDayComponent();
        Button b =(Button)c;
        System.err.println("com:" +b+" text:" +b.getText());
        b.setText("GH");
        return c;
    }
    @Override protected Label createDayTitle(int day){
        //this create label for SUMTF
        Label l =super.createDayTitle(day);
        System.err.println("label: "+l.getText()+" d: "+day);
        return l;
    }
    @Override protected String getDayText(Component cmp){
        String s=super.getDayText(cmp);
        System.err.println("TEXT: "+s);
        return s;
    }
    @Override protected void updateButtonDayDate(Component dayButton, int currentMonth, int day){
        System.err.println("dayButton: "+dayButton+ " m: "+currentMonth+ " d: "+day);
        Button b=(Button)dayButton;
        b.setText("M");
        super.updateButtonDayDate(dayButton, currentMonth, day);
    }
    @Override protected void updateButtonDayDate(Component dayButton, int year, int currentMonth, int day){
        System.err.println("dayButton: "+dayButton+ " Y: "+year+" m: "+currentMonth+ " d: "+day);
        Button b=(Button)dayButton;
        b.setText("Y");
        super.updateButtonDayDate(dayButton, currentMonth, day);
    }

};

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题