@Override
		public void paint(Graphics g, JComponent c) {
			super.paint(g, c);

			if (c.isEnabled()) {
				return;
			}

			Color disabledColor = getColorForComponent(c);

			Graphics2D g2 = (Graphics2D) g.create();

			int w = c.getWidth();
			int h = c.getHeight();
			g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .5f));
			g2.setPaint(disabledColor);
			g2.fillRect(0, 0, w, h);

			g2.dispose();
		}
A factory to create JLayer instances to provide the L&amp;F and functionality of a 
disabled panel -- the component assumes a disabled color, and selection via mouse and
keyboard is prevented. As this is simply a layer in the UI stack, previous states of 
components is maintained and unmodified.
Ghidra/Framework/Docking/src/main/java/docking/DisabledComponentLayerFactory.java