diff --git a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java index 98712e3..22f4fd3 100644 --- a/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java +++ b/ts3-client/swing/src/main/java/com/ts3client/ui/ServerTabPane.java @@ -9,6 +9,7 @@ import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JTabbedPane; +import javax.swing.SwingUtilities; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -60,6 +61,16 @@ final class ServerTabPane extends JPanel { dragReorder.attach(tabbed); } + /** + * The tab strip is out of the component tree while a single server is open, so a + * look-and-feel switch would miss it and leave it in the old theme's colours. + */ + @Override + public void updateUI() { + super.updateUI(); + if (tabbed != null && tabbed.getParent() == null) SwingUtilities.updateComponentTreeUI(tabbed); + } + /** Drags a tab from one position to another, keeping the current selection on screen. */ private void moveTab(int from, int to) { if (from < 0 || to < 0 || from >= tabs.size() || to >= tabs.size() || from == to) return;