3 import java.awt.event.*;
9 private Button dontSave, cancel, save;
13 super(
new JFrame(),
"Save?",
true);
14 setLayout(
new BorderLayout());
15 Panel panel =
new Panel();
16 panel.setLayout(
new FlowLayout(FlowLayout.LEFT, 10, 10));
18 if (fileName.startsWith(
"Save "))
19 message =
new Label(fileName);
21 if (fileName.length()>22)
22 message =
new MultiLineLabel(
"Save changes to\n" +
"\"" + fileName +
"\"?");
24 message =
new Label(
"Save changes to \"" + fileName +
"\"?");
26 message.setFont(
new Font(
"Dialog", Font.BOLD, 12));
31 panel.setLayout(
new FlowLayout(FlowLayout.CENTER, 8, 8));
32 save =
new Button(
" Save ");
33 save.addActionListener(
this);
34 cancel =
new Button(
" Cancel ");
35 cancel.addActionListener(
this);
36 dontSave =
new Button(
"Don't Save");
37 dontSave.addActionListener(
this);
38 if (ij.IJ.isMacintosh()) {
48 if (ij.IJ.isMacintosh())
55 public void actionPerformed(ActionEvent e) {
56 if (e.getSource()==cancel)
58 else if (e.getSource()==save)