Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Basic Radio button text color question
Basic Radio button text color question [message #558590] Mon, 13 September 2010 15:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 1
Registered: September 2010
Junior Member
I have created a radio button and set some text to describe it.

Using the setForeground method does not work to change the color of the text.

Using setBackground does work but the text remains the default color.

Does anyone know how to change the radio button's text color?

final Button radioButton1 = new Button(shell, SWT.RADIO);
   radioButton1.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
    radioButton1.setText("Java");
    radioButton1.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
Re: Basic Radio button text color question [message #558719 is a reply to message #558590] Tue, 14 September 2010 08:11 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
On 13.09.2010 17:30, mdlafleur@yahoo.com wrote:
> I have created a radio button and set some text to describe it.
>
> Using the setForeground method does not work to change the color of the
> text.
>
> Using setBackground does work but the text remains the default color.
>
> Does anyone know how to change the radio button's text color?

Please read the documentation of the setter functions:

* Note: This operation is a hint and may be overridden by the platform.
* For example, on Windows the background of a Button cannot be changed.

Greetings from Bremen,

Daniel Krügler
Previous Topic:Reordering widgets within composite
Next Topic:Custom widget problem
Goto Forum:
  


Current Time: Wed Dec 13 20:48:36 GMT 2017

Powered by FUDForum. Page generated in 0.02069 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software