when updating, first send WINDOW_CLOSING event then call updateApp when windowClosed
parent
e48b40a560
commit
dde02189fc
|
@ -252,11 +252,9 @@ public class MagicFrame extends JFrame implements ActionListener {
|
||||||
preferencesItem.addActionListener(this);
|
preferencesItem.addActionListener(this);
|
||||||
tournamentMenu.add(preferencesItem);
|
tournamentMenu.add(preferencesItem);
|
||||||
|
|
||||||
/*
|
|
||||||
updateItem=new JMenuItem("Update");
|
updateItem=new JMenuItem("Update");
|
||||||
updateItem.addActionListener(this);
|
updateItem.addActionListener(this);
|
||||||
tournamentMenu.add(updateItem);
|
//tournamentMenu.add(updateItem);
|
||||||
*/
|
|
||||||
|
|
||||||
quitItem=new JMenuItem("Quit");
|
quitItem=new JMenuItem("Quit");
|
||||||
quitItem.addActionListener(this);
|
quitItem.addActionListener(this);
|
||||||
|
@ -504,7 +502,13 @@ public class MagicFrame extends JFrame implements ActionListener {
|
||||||
} else if (source==quitItem) {
|
} else if (source==quitItem) {
|
||||||
processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
|
processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
|
||||||
} else if (source==updateItem) {
|
} else if (source==updateItem) {
|
||||||
updateApp();
|
this.addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosed(final WindowEvent event) {
|
||||||
|
updateApp();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
processWindowEvent(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
|
||||||
} else if (source==cardExplorerItem) {
|
} else if (source==cardExplorerItem) {
|
||||||
openCardExplorer();
|
openCardExplorer();
|
||||||
} else if (source==keywordsItem) {
|
} else if (source==keywordsItem) {
|
||||||
|
|
Loading…
Reference in New Issue