JComponent () { if (useDialogWrapperSouthPanel()) return super.createSouthPanel(); JPanel panel = new JPanel(new BorderLayout()); int inset = isNewWizard() ? 15 : 0; panel.setBorder(isNewWizard() ? BorderFactory.createEmptyBorder(4, inset, 4, inset) : BorderFactory.createEmptyBorder(8, inset, 0, inset)); JPanel buttonPanel = new JPanel(); if (SystemInfo.isMac) { panel.add(buttonPanel, BorderLayout.EAST); buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS)); if (!StartupUiUtil.isUnderDarcula()) { myHelpButton.putClientProperty("JButton.buttonType", "help"); } final List<JButton> touchbarButtons = new ArrayList<>(); JPanel leftPanel = new JPanel(); if (ApplicationInfo.contextHelpAvailable()) { leftPanel.add(myHelpButton); touchbarButtons.add(myHelpButton); } leftPanel.add(myCancelButton); touchbarButtons.add(myCancelButton); panel.add(leftPanel, BorderLayout.WEST); List<JButton> principalTouchbarButtons = new ArrayList<>(); if (mySteps.size() > 1) { buttonPanel.add(Box.createHorizontalStrut(5)); buttonPanel.add(myPreviousButton); principalTouchbarButtons.add(myPreviousButton); } buttonPanel.add(Box.createHorizontalStrut(5)); buttonPanel.add(myNextButton); principalTouchbarButtons.add(myNextButton); Touchbar.setButtonActions(panel, touchbarButtons, principalTouchbarButtons, myNextButton); } else { panel.add(buttonPanel, BorderLayout.CENTER); GroupLayout layout = new GroupLayout(buttonPanel); buttonPanel.setLayout(layout); layout.setAutoCreateGaps(true); final GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup(); final GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(); final Collection<Component> buttons = new ArrayList<>(5); final boolean helpAvailable = ApplicationInfo.contextHelpAvailable(); add(hGroup, vGroup, null, Box.createHorizontalGlue()); if (mySteps.size() > 1) { add(hGroup, vGroup, buttons, myPreviousButton); } add(hGroup, vGroup, buttons, myNextButton, myCancelButton); if (helpAvailable) { if (isNewWizard()) { JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); if (ApplicationInfo.contextHelpAvailable()) { leftPanel.add(myHelpButton); panel.add(leftPanel, BorderLayout.WEST); } } else { add(hGroup, vGroup, buttons, myHelpButton); } } layout.setHorizontalGroup(hGroup); layout.setVerticalGroup(vGroup); layout.linkSize(buttons.toArray(new Component[0])); } myPreviousButton.setEnabled(false); myPreviousButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { doPreviousAction(); } }); myNextButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { proceedToNextStep(); } }); myCancelButton.addActionListener( new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { doCancelAction(); } } ); if (!isNewWizard()) { myHelpButton.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { helpAction(); } }); } return panel; }