1

I want to change the border color of the composite using form tool kit.But the result is something unexpected.It sets the background to white.

CODE:

 FormColors formColor = new FormColors(Display.getCurrent());
    formColor.createColor(FormColors.BORDER, 160, 32, 240);
    formColor.setForeground(new Color(Display.getCurrent(), 160, 32, 240));

    FormToolkit formToolkit = new FormToolkit(formColor);
    formToolkit.paintBordersFor(composite);
    Composite child=formtoolkit.createcomposite(composite)
     formtoolkit.paintBordersFor(child)

But this code has no effect on the border of the composite .an anyone tell me what am i doing wrong.

4

1 回答 1

0

显然,您需要添加以下代码以在内部更新边框颜色:

formColor.setBackground(new Color(Display.getCurrent(), 255, 255, 255)); 

来源: http: //www.eclipsezone.com/eclipse/forums/t61092.html

于 2013-05-10T08:00:12.697 回答