Jskad won't allow you to exit by closing the last window anymore. Instead,
you get a dialog box saying to use File/Exit.
This commit is contained in:
parent
6c286573ba
commit
7500b4e06b
1 changed files with 10 additions and 3 deletions
|
@ -209,8 +209,15 @@ public class Jskad extends JPanel implements DocumentListener {
|
||||||
JMenuItem closeItem = new JMenuItem("Close");
|
JMenuItem closeItem = new JMenuItem("Close");
|
||||||
closeItem.addActionListener(new ThdlActionListener() {
|
closeItem.addActionListener(new ThdlActionListener() {
|
||||||
public void theRealActionPerformed(ActionEvent e) {
|
public void theRealActionPerformed(ActionEvent e) {
|
||||||
|
if (numberOfTibsRTFOpen == 1) {
|
||||||
|
JOptionPane.showMessageDialog(Jskad.this,
|
||||||
|
"You cannot close the last Jskad window.\nUse File/Exit if you intend to exit.",
|
||||||
|
"Cannot close last Jskad window",
|
||||||
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
} else {
|
||||||
if (!hasChanged || hasChanged && checkSave(JOptionPane.YES_NO_CANCEL_OPTION)) {
|
if (!hasChanged || hasChanged && checkSave(JOptionPane.YES_NO_CANCEL_OPTION)) {
|
||||||
Jskad.this.realCloseAction(true);
|
Jskad.this.realCloseAction(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue