Setting JPanel colors has no effect in the toolwindow
已回答
this.contentFactory = ContentFactory.getInstance();
this.contentManager = toolWindow.getContentManager();
JPanel jPanel = new JPanel(new BorderLayout());
JLabel jLabel = new JLabel("hi, is my chat");
jLabel.setOpaque(true);
jLabel.setBackground(Color.RED);
jPanel.setBackground(Color.RED);
jPanel.add(jLabel, BorderLayout.CENTER);
Content content = contentFactory.createContent(jPanel, "", false);
contentManager.addContent(content);

How to solve the problem of color in the desired effect? Thank you
请先登录再写评论。
Hi,
It is not possible to do by plugins.
Background of all components is overriden in https://github.com/JetBrains/intellij-community/blob/243/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.kt . See
InternalDecoratorImpl.Companion#setBackgroundRecursively()
calls. This is an internal API, and I don't see any way of disabling this behavior by plugins.