JBTabbedPane UI replaced after theme switch


Hello. Would you help me fix a problem

I added a toolwindow by a plugin with JBTabbedPane in it.

When a user switches the theme from Intellij to Darcula and back (or vice-versa), IDE gets side UI instead of my class.

Steps to reproduce:

0. https://github.com/yrakovets/tabbedPaneTest.git

1. task runIDE

2. open project

3. change the theme to Darcula and apply

4. change the theme to Intellij and apply


Expected: JBTabbedPane UI will be similar after 2nd step and after 4th step

Actual :


Comment actions Permalink

For toolwindows one would usually use builtin functionality for tabs, com.intellij.ui.content.ContentManager#addContent(com.intellij.ui.content.Content) where each Content represents one separate tab. Does it work for you?

Comment actions Permalink

I used that class



I made the fix for my problem. It doesn't work correctly in the sample, but in my project it does. I "return" the UI back in PropertyChangeListener) 

pane.addPropertyChangeListener(evt -> {
if (!pane.getUI().equals(ui)) {

The question can be marked as answered, but as for me, IDE behavior is incorrect

Vassiliy Kudryashov
Comment actions Permalink

This behaviour is expected, on switching look-n-feel every component get UI according to LookAndFeel. So you may override setUI() method and always set your own special UI there instead of original one.


Please sign in to leave a comment.