JPanel (@Nullable final String preferredEnvironment) { final JPanel container = new JPanel(new BorderLayout()); final JPanel decoratorPanel = new JPanel(new VerticalFlowLayout()); final List<Sdk> allExistingSdks = Arrays.asList(PyConfigurableInterpreterList.getInstance(null).getModel().getSdks()); final List<Sdk> existingSdks = getValidPythonSdks(allExistingSdks); final Sdk preferredSdk = getPreferredSdk(existingSdks); final String newProjectPath = getProjectLocation(); final PyAddNewEnvironmentPanel newEnvironmentPanel = new PyAddNewEnvironmentPanel(allExistingSdks, newProjectPath, preferredEnvironment); final PyAddExistingSdkPanel existingSdkPanel = new PyAddExistingSdkPanel(null, null, existingSdks, newProjectPath, preferredSdk); PyAddSdkPanel defaultPanel = PySdkSettings.getInstance().getUseNewEnvironmentForNewProject() ? newEnvironmentPanel : existingSdkPanel; myInterpretersDecorator = new HideableDecorator(decoratorPanel, getProjectInterpreterTitle(defaultPanel).toString(), false); myInterpretersDecorator.setContentComponent(container); final List<PyAddSdkPanel> panels = Arrays.asList(newEnvironmentPanel, existingSdkPanel); myInterpreterPanel = new PyAddSdkGroupPanel(PyBundle.messagePointer("python.add.sdk.panel.name.new.project.interpreter"), getIcon(), panels, defaultPanel); myInterpreterPanel.addChangeListener(() -> { myInterpretersDecorator.setTitle(getProjectInterpreterTitle(myInterpreterPanel.getSelectedPanel()).toString()); final boolean useNewEnvironment = myInterpreterPanel.getSelectedPanel() instanceof PyAddNewEnvironmentPanel; PySdkSettings.getInstance().setUseNewEnvironmentForNewProject(useNewEnvironment); checkValid(); }); addLocationChangeListener(event -> myInterpreterPanel.setNewProjectPath(getProjectLocation())); container.add(myInterpreterPanel, BorderLayout.NORTH); checkValid(); return decoratorPanel; }