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,9 +209,16 @@ public class Jskad extends JPanel implements DocumentListener {
|
|||
JMenuItem closeItem = new JMenuItem("Close");
|
||||
closeItem.addActionListener(new ThdlActionListener() {
|
||||
public void theRealActionPerformed(ActionEvent e) {
|
||||
if (!hasChanged || hasChanged && checkSave(JOptionPane.YES_NO_CANCEL_OPTION)) {
|
||||
Jskad.this.realCloseAction(true);
|
||||
}
|
||||
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)) {
|
||||
Jskad.this.realCloseAction(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
fileMenu.add(closeItem);
|
||||
|
|
Loading…
Reference in a new issue