diff --git a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java index eb8c4c35..45cf3742 100644 --- a/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java +++ b/flatlaf-demo/src/main/java/com/formdev/flatlaf/demo/intellijthemes/IJThemesPanel.java @@ -198,14 +198,14 @@ public class IJThemesPanel } private void themesListValueChanged( ListSelectionEvent e ) { - if( e.getValueIsAdjusting() || isAdjustingThemesList ) - return; - IJThemeInfo themeInfo = themesList.getSelectedValue(); boolean bundledTheme = (themeInfo != null && themeInfo.resourceName != null); saveButton.setEnabled( bundledTheme ); sourceCodeButton.setEnabled( bundledTheme ); + if( e.getValueIsAdjusting() || isAdjustingThemesList ) + return; + EventQueue.invokeLater( () -> { setTheme( themeInfo ); } );