Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forumshow to change colour of label in swt tree editor
https://www.eclipse.org/forums/index.php/mv/msg/459584/1019345/#msg_1019345
Label label = new Label(this.tree ,SWT.RIGHT);
label.setFont(new Font(getSite().getShell().getDisplay(), ("Hello"), 18,
SWT.BOLD));
label.setText("hello:));
label.pack();
treeItem.setText(1, hi + " " + label.getText());
How could I accomplish this?]]>abc test2013-03-15T13:55:04-00:00Re: how to change colour of label in swt tree editor
https://www.eclipse.org/forums/index.php/mv/msg/459584/1021736/#msg_1021736
I think you are looking for a IStyledLabelProvider.
Best regards,
Wim
> I have a TreeEditor and some text in its first column. I need to append
some text to it using a label or string. In addition, I want to change the
color of the appended string to green. I tried to do it with this code, but
it isn't working:
>
> Label label = new Label(this.tree ,SWT.RIGHT);
> label.setFont(new Font(getSite().getShell().getDisplay(), ("Hello"), 18,
> SWT.BOLD));
> label.setText("hello:));
> label.pack();
> treeItem.setText(1, hi + " " + label.getText());
>
> How could I accomplish this?]]>Wim Jongman2013-03-20T15:44:18-00:00