简体   繁体   中英

SWT composite and group

I want to put text inside the composite and group, but for some reason, the text didn't show up on the UI. Can anyone give me some suggestion? thank you!

    data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    data.horizontalSpan = 2;
    Group group1 = new Group(shell, SWT.SHADOW_IN);
    group1.setText("This is my group");
    group1.setLayoutData(data);
    Text text = new Text(group1, SWT.NONE);
    text.setText("Group test with label");
group1.setLayout(new RowLayout(SWT.VERTICAL));

这样可以解决问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM