Eclipse 4 RCP中的团队设计

同名

我想通过使用eclipse 4 RCP在组合上的组中添加图像和标签。示例图片如下所示。我怎样才能做到这一点?

示例图片

我的示例代码如下:

Group group_incom = new Group(dynamicDataComp, SWT.NONE);
    group_incom.setLayout(new GridLayout(2,true));
    group_incom.setText("Incom. Msg.");
    Label lbl_incomMsg = toolkit.createLabel(group_incom, "# of Incoming Messages : ", SWT.NONE);
    Image img = new Image(lbl_incomMsg.getDisplay(), "<path>");
    lbl_incomMsg.setImage(img);
    lbl_incomMsg.setLocation(15, 15);
    lbl_incomMsg.pack();

问题是,我可以看到图像,但看不到标签文本。

greg-449

Label可以显示文字图像,但不会同时显示。因此,要么使用两个Label控件,一个用于图像,一个控件用于文本,要么使用CLabel可以同时显示这两个控件的控件

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章