[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Changing the look of a LinkLabel

Hi,

I have some LinkLabel's I am displaying in a Composite.  I am trying to 
change the look of the label via the following code.  Only the background 
color changes, the foreground and font style are ignored.  Is this the 
expected behavior?

LinkLabel l1 = new LinkLabel(selectionComposite, SWT.NONE);

// Make the text foreground red

l1.setForeground(this.getDisplay().getSystemColor(SWT.COLOR_DARK_RED));

// Make the text background gray

l1.setBackground(this.getDisplay().getSystemColor(SWT.COLOR_GRAY));

// Make the text font bold

FontData fontData = l1.getFont().getFontData()[0];

fontData.setStyle(SWT.BOLD | fontData.getStyle());

Font font = new Font(this.getDisplay(), fontData);

l1.setFont(font);