0

标题是不言自明的,我目前正在PaintListener为我想绘制的控件的所有子项、孙子项等添加 s。目前我有Tables 和Combos 的图形错误,PaintListener 显然不适用于组合中的标题或按钮。

我怎样才能做到这一点?

这是我用来添加侦听器的代码:

List<Control> controls = Lists.newArrayList();
controls.add(composite);

while (! controls.isEmpty()) {

    Control c = controls.remove(0); 
    if (c instanceof Composite) {
        controls.addAll(Arrays.asList(((Composite) c).getChildren()));
    }

    c.addPaintListener(new ControlPaintListener());
}
4

0 回答 0