void (TabbedPaneWrapper tabbedPane) { final List<String> standardTabsOrder = Arrays.asList( ArtifactPropertiesEditor.VALIDATION_TAB_POINTER.get(), ArtifactPropertiesEditor.PRE_PROCESSING_TAB_POINTER.get(), ArtifactPropertiesEditor.POST_PROCESSING_TAB_POINTER.get() ); List<@NlsContexts.TabTitle String> sortedTabs = new ArrayList<>(myMainPanels.keySet()); sortedTabs.sort((o1, o2) -> { int i1 = standardTabsOrder.indexOf(o1); if (i1 == -1) i1 = standardTabsOrder.size(); int i2 = standardTabsOrder.indexOf(o2); if (i2 == -1) i2 = standardTabsOrder.size(); if (i1 != i2) { return i1 - i2; } return o1.compareTo(o2); }); for (@NlsContexts.TabTitle String tab : sortedTabs) { tabbedPane.addTab(tab, new JBScrollPane(myMainPanels.get(tab))); } }