Setting background and font colors for RichTextField, TextField

后端 未结 2 2043
暖寄归人
暖寄归人 2020-12-21 17:13

How do we set the background and font colors in a RichTextField? I tried to override the paint() method in addition to what has been described here, but when I scroll down i

2条回答
  •  北海茫月
    2020-12-21 17:20

    RichTextField mes_=new RichTextField("texto de ejemplo",Field.NON_FOCUSABLE){
        protected void paint(Graphics g){ 
            g.setColor(0x00e52f64);
            super.paint(g);
        }
    };
    mes_.setBackground(BackgroundFactory.createSolidBackground(0xFFFADDDA));
    

    The method incrustaded in the declaration its for changing the color of the font. The method called after created its for changing the background to a solid color.

提交回复
热议问题