Search code examples
javacolorsbackgroundswtforeground

ExpandBar/ExpandItem background/foreground colors in Java SWT


I'm looking to manage colors of headers of my expandItem in SWT, and I'm not able to change the background or the foreground (swt gtk 32bit) or only background (swt win 64).

Is there some particular way to do that? I'm already setting:

exp_bar.setBackground(new Color(display, GUISetting.MAIN_BACKGROUND));
exp_bar.setForeground(new Color(display, GUISetting.MAIN_TEXT_COLOR));

But this does not seem to work. Any ideas?


Solution

  • In SWT, these widgets are supplied by OS. if you look at documentation setBackground(), it says the parameters are just hints. they might be honored or not, it all depends on OS.