Skip to content

Commit e709a4e

Browse files
committed
Fix a bug that prevented login screen from opening
1 parent c959e8a commit e709a4e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tmc-plugin/src/fi/helsinki/cs/tmc/ui/LoginDialog.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import java.awt.event.WindowEvent;
1313
import javax.swing.JOptionPane;
1414
import javax.swing.SwingUtilities;
15-
import org.openide.util.Exceptions;
1615

1716
public class LoginDialog extends javax.swing.JDialog {
1817

@@ -60,6 +59,17 @@ public void run() {
6059

6160
this.onLogin = onLogin;
6261
this.visible = true;
62+
63+
/* Add a windowlistener to the dialog to track when the dialog is closed
64+
* from the x-button
65+
*/
66+
this.addWindowListener(new WindowAdapter() {
67+
@Override
68+
public void windowClosing(WindowEvent e) {
69+
visible = false;
70+
super.windowClosing(e);
71+
}
72+
});
6373
}
6474

6575
public static boolean isWindowVisible() {

0 commit comments

Comments
 (0)