JComponent (JComponent middleItemComponent) { myNextStepLabel = new JLabel(); JPanel left = new JPanel(new BorderLayout()); left.add(middleItemComponent, BorderLayout.CENTER); JPanel right = new JPanel(new GridBagLayout()); myButtonsSeparator = createButtonsSeparator(); left.add(myButtonsSeparator, BorderLayout.EAST); if (myIconBar != null) { left.add(myIconBar, BorderLayout.WEST); } JPanel result; if (ExperimentalUI.isNewUI()) { result = new SelectablePanel(); result.setOpaque(false); PopupUtil.configListRendererFixedHeight(((SelectablePanel)result)); } else { result = new JPanel(); result.setBorder(JBUI.Borders.empty()); } result.setLayout(new GridBagLayout()); Insets insets = getDefaultItemComponentBorder().getBorderInsets(result); if (ExperimentalUI.isNewUI()) { left.setBorder(JBUI.Borders.empty()); right.setBorder(JBUI.Borders.empty()); } else { int leftRightInset = (ListPopupImpl.NEXT_STEP_AREA_WIDTH - AllIcons.Icons.Ide.MenuArrow.getIconWidth()) / 2; left.setBorder(JBUI.Borders.empty(insets.top, insets.left, insets.bottom, 0)); right.setBorder(JBUI.Borders.empty(insets.top, leftRightInset, insets.bottom, insets.right)); } GridBag gbc = new GridBag() .setDefaultAnchor(0, GridBagConstraints.WEST) .setDefaultWeightX(0, 1) .setDefaultAnchor(GridBagConstraints.CENTER) .setDefaultWeightX(0) .setDefaultWeightY(1) .setDefaultPaddingX(0) .setDefaultPaddingY(0) .setDefaultInsets(0, 0, 0, 0) .setDefaultFill(GridBagConstraints.BOTH); result.add(left, gbc.next()); result.add(right, gbc.next()); myMainPane = left; myButtonPane = right; return result; }