为水平管理器的某个部分着色

时间:2012-06-08 13:19:33

标签: blackberry

我有一个水平管理器,显示3个标签字段,屏幕上显示“1:00 Event1”,我想设置hfm的背景颜色仅覆盖1点,我该怎么做?

HorizontalFieldManager horizontalFieldManager_left15 = new HorizontalFieldManager(
                Manager.HORIZONTAL_SCROLL);

        horizontalFieldManager_left15.add(time15Label);
        horizontalFieldManager_left15.add(min15Label);

         horizontalFieldManager_left15.add(evetnLabel);

由于

1 个答案:

答案 0 :(得分:1)

参考这个 -

HorizontalFieldManager horizontalFieldManager_left15 = new HorizontalFieldManager(
            Manager.HORIZONTAL_SCROLL);

LabelField lb = new LabelField(time15Label)  {

//设置背景颜色

protected void paint(Graphics graphics) {
         graphics.setColor(Color.LAVENDAR);
            super.paint(graphics);
        }
    };

//设置TextArea的背景颜色

 protected void paintBackground(Graphics graphics) {
         graphics.setBackgroundColor(Color.GOLDENROD);
         graphics.clear();
        }
    };



   horizontalFieldManager_left15.add(time15Label);