Minimize Area background color

How can i set the background color of minimize areas? I’ve searched through the source code with no luck. I also tried control.getContentArea().getWestArea().setBackground(Color.red) with no luck.

It’s a bit tricky because these Components used by the framework usually are a combination of several Components. But you can use a “BackgroundPaint” to achieve a different color:


import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.JFrame;

import bibliothek.gui.dock.common.CControl;
import bibliothek.gui.dock.common.CLocation;
import bibliothek.gui.dock.common.DefaultSingleCDockable;
import bibliothek.gui.dock.themes.ThemeManager;
import bibliothek.gui.dock.util.BackgroundComponent;
import bibliothek.gui.dock.util.BackgroundPaint;
import bibliothek.gui.dock.util.PaintableComponent;

public class BackgroundColorTest {
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		frame.setBounds(20, 20, 400, 400);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		CControl control = new CControl(frame);
		frame.add(control.getContentArea());
		
		DefaultSingleCDockable dockable = new DefaultSingleCDockable("a", "Aaaa");
		control.addDockable(dockable);
		dockable.setLocation(CLocation.base().minimalEast());
		dockable.setVisible(true);
		
		ThemeManager themeManager = control.getController().getThemeManager();
		BackgroundPaint paint = new BackgroundPaint() {
			@Override
			public void uninstall(BackgroundComponent component) {
				// ignore
			}
			
			@Override
			public void paint(BackgroundComponent background,
					PaintableComponent paintable, Graphics g) {
		
				Dimension size = background.getComponent().getSize();
				
				paintable.paintBackground(g);
				g.setColor(Color.BLUE);
				g.fillRect(0, 0, size.width, size.height);
			}
			
			@Override
			public void install(BackgroundComponent component) {
				// ignore
			}
		};
		themeManager.setBackgroundPaint(ThemeManager.BACKGROUND_PAINT + ".station.flap", paint);
		
		frame.setVisible(true);
	}
}