Java – how to set SWT label filling?

When I assign text to my tags, they wrap around it very closely, sometimes cutting the lower edge off 'p', 'y', etc I want some padding between the text and the border I use tablewraployout as the parent composite and tablewrapdata of the tag

TableWrapLayout layout = new TableWrapLayout();
    layout.numColumns = 2;
    layout.bottomMargin = 10;
    layout.topMargin = 10;
    client.setLayout(layout);

    Label label= toolkit.createLabel(client,"",SWT.NONE);

We use the formtoolkit for consistent design. With all due respect, this has no impact on border painting

Solution

Layout (such as GridLayout) and layoutdata (such as griddata) objects in SWT can only control the spacing outside the control (so they can only set the margin instead of filling) To change the control side itself, you can only use setsize() and setbound()

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>