public DialogOptions showFileOverwriteDialog(String title, String message) { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(new JLabel(message)); JCheckBox applyToAll = new JCheckBox(); JPanel applyPanel = new JPanel(); applyPanel.add(new JLabel("Apply to all")); applyPanel.add(applyToAll); panel.add(applyPanel); int choice = JOptionPane.showConfirmDialog( getProjectExplorer(), panel, title, JOptionPane.YES_NO_OPTION, JOptionPane.PLAIN_MESSAGE); DialogOptions options = new DialogOptions(); options.dialogResult = choice == JOptionPane.YES_OPTION; options.applyToAll = applyToAll.isSelected(); return options; }