diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java
index f13e928d4..f2b896b14 100644
--- a/java/src/processing/mode/java/JavaEditor.java
+++ b/java/src/processing/mode/java/JavaEditor.java
@@ -2029,21 +2029,16 @@ public class JavaEditor extends Editor {
try {
if (sketch.isModified() && !sketch.isUntitled()) {
if (JavaMode.autoSavePromptEnabled) {
- final JDialog autoSaveDialog = new JDialog(
- base.getActiveEditor(), this.getSketch().getName(),
- true);
+ final JDialog autoSaveDialog =
+ new JDialog(base.getActiveEditor(), getSketch().getName(), true);
Container container = autoSaveDialog.getContentPane();
JPanel panelMain = new JPanel();
- panelMain.setBorder(BorderFactory.createEmptyBorder(4, 0,
- 2, 2));
- panelMain.setLayout(new BoxLayout(panelMain,
- BoxLayout.PAGE_AXIS));
+ panelMain.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 2));
+ panelMain.setLayout(new BoxLayout(panelMain, BoxLayout.PAGE_AXIS));
- JPanel panelLabel = new JPanel(new FlowLayout(
- FlowLayout.LEFT));
- JLabel label = new JLabel(
- "
There are unsaved"
+ JPanel panelLabel = new JPanel(new FlowLayout(FlowLayout.LEFT));
+ JLabel label = new JLabel(" There are unsaved"
+ " changes in your sketch.
"
+ " Do you want to save it before"
+ " running? ");
@@ -2051,14 +2046,11 @@ public class JavaEditor extends Editor {
Font.PLAIN, label.getFont().getSize() + 1));
panelLabel.add(label);
panelMain.add(panelLabel);
- final JCheckBox dontRedisplay = new JCheckBox(
- "Remember this decision");
+ final JCheckBox dontRedisplay = new JCheckBox("Remember this decision");
+ JPanel panelButtons = new JPanel(new FlowLayout(FlowLayout.CENTER, 8, 2));
- JPanel panelButtons = new JPanel(new FlowLayout(
- FlowLayout.CENTER, 8, 2));
JButton btnRunSave = new JButton("Save and Run");
btnRunSave.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
handleSave(true);
@@ -2071,9 +2063,9 @@ public class JavaEditor extends Editor {
}
});
panelButtons.add(btnRunSave);
+
JButton btnRunNoSave = new JButton("Run, Don't Save");
btnRunNoSave.addActionListener(new ActionListener() {
-
@Override
public void actionPerformed(ActionEvent e) {
if (dontRedisplay.isSelected()) {
@@ -2088,8 +2080,7 @@ public class JavaEditor extends Editor {
panelMain.add(panelButtons);
JPanel panelCheck = new JPanel();
- panelCheck
- .setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
+ panelCheck.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
panelCheck.add(dontRedisplay);
panelMain.add(panelCheck);
@@ -2107,7 +2098,6 @@ public class JavaEditor extends Editor {
} catch (Exception e) {
statusError(e);
}
-
}