Reputation: 27
I heard that Label
is impossible, but CLabel
is possible.
How to use CLabel
to add text & image?
private CLabel label = new CLabel(composite, SWT.CENTER);
label.setBounds(93,35,192, 20);
label.setImage(SWTResourceManager.getImage("C:\\Users\\Screen.png"));
label.setText(memName + "'s Planet");
this is my code. but only display text or image....
Upvotes: 0
Views: 511
Reputation: 111142
CLabel
does display the image and the text.
However if there is not enough space for both the image and the text it will leave out the image - so check you have enough space for both.
To display a background image call the CLabel
setBackground(image)
method.
Upvotes: 0