境界を設定しないと、以下のコードで期待どおりにラベルが表示されません。このコンポジット内に背景画像のみを表示したいので、シェル内にコンポジットを作成しています。
この場合、境界はどうあるべきですか?ラベルのテキストに基づいて最適な境界を取得できますか?
Display display = PlatformUI.createDisplay();
Shell shell = new Shell(display);
shell.setText("Header);
Composite main = new Composite(shell, SWT.NONE);
main.setBounds(10, 5, 775, 505);
InputStream is = getClass().getResourceAsStream("/resources/bg.png");
Image bg = new Image(display, is);
main.setBackgroundImage(bg);
main.setBackgroundMode(SWT.INHERIT_DEFAULT);
Label label = new Label(main, SWT.NONE);
//label.setBounds(0, 0, 400,100); // not showing if commented away
label.setText("Label 1");