Made application terminate when GameModeDialog is closed
This commit is contained in:
parent
4f57c34a81
commit
54e73f2b85
@ -1,6 +1,8 @@
|
||||
package dev.kske.chess.ui;
|
||||
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -35,6 +37,15 @@ public class GameModeDialog extends JDialog {
|
||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||
getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
||||
|
||||
// Exit application when the close button is pressed
|
||||
addWindowListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent evt) {
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
final BoardComponent boardComponent = boardPane.getBoardComponent();
|
||||
final OverlayComponent overlayComponent = boardPane.getOverlayComponent();
|
||||
final Board board = boardComponent.getBoard();
|
||||
|
Reference in New Issue
Block a user