Changing background

In case an alarm event is received, I like to highlight the “Alarm” dockable.
For example by flashing the background of the title and the button when the dockable is minimized.

Any suggestions?

Guide for Common, chapter 3.4.

2 ColorMap map = dockable.getColors() ;
3 map.setColor( ColorMap .COLOR KEY TAB BACKGROUND, Color .RED ) ;

Well, you’d have to search the right keys in the documentation.

Uh, I think this does not yet work for minimized Dockables, but it is already on the todo list.

Changing the background color of a “flap button” (minimized dockable) works now also with the latest version.

Changing the background color of the tab doesn’t work for the BasicStackDockComponent (JTabbedPane), the foreground (text) color changes (and not with the correct color).
Changing the foreground color of the tab does work.

MetalLookAndFeel is just not interested in the background I set for a JTabbedPane, it works when using the WinXP-LookAndFeel. I’ve no idea how to repair that.

The foreground (if not set explicitly) is calculated using the background. If the background is “bright” (meaning, the sum of red, green and blue is bigger than 2/3*256) then the foreground is set to black, otherwise to white (might be a good idead to use HSB instead of RGB, but that is another problem).

OK, that explains it.
So, in case you want to use tab background colors, do not use the BasicStackDockComponent class but a class that extends CombinedStackDockComponent