Skip to content

Commit 7938235

Browse files
committed
make deepsource not yell at me
1 parent 09709ad commit 7938235

File tree

9 files changed

+34
-14
lines changed

9 files changed

+34
-14
lines changed

src/main/java/lol/hyper/customlauncher/districts/DistrictTracker.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ public void showWindow() {
7979
districtTable.getTableHeader().setReorderingAllowed(false);
8080
districtTable.setFocusable(false);
8181
JScrollPane scrollPane = new JScrollPane(districtTable);
82-
scrollPane.setVisible(true);
8382
panel.add(scrollPane);
8483

8584
// district label
@@ -96,11 +95,9 @@ public void showWindow() {
9695
timer.setDelay(500);
9796
timer.start();
9897

99-
frame.pack();
10098
frame.setSize(500, 400);
10199
frame.add(panel);
102100
frame.setLocationRelativeTo(null);
103-
frame.setVisible(true);
104101

105102
// stop the schedules here, so they don't run while the window is closed
106103
frame.addWindowListener(
@@ -110,6 +107,11 @@ public void windowClosing(java.awt.event.WindowEvent windowEvent) {
110107
timer.stop();
111108
}
112109
});
110+
111+
SwingUtilities.invokeLater(()-> {
112+
frame.pack();
113+
frame.setVisible(true);
114+
});
113115
}
114116

115117
/** Updates the district list on the actual GUI. */

src/main/java/lol/hyper/customlauncher/fieldofficetracker/FieldOfficeTracker.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,9 @@ public void showWindow() {
110110
timer.setDelay(500);
111111
timer.start();
112112

113-
frame.pack();
114113
frame.setSize(500, 400);
115114
frame.add(panel);
116115
frame.setLocationRelativeTo(null);
117-
frame.setVisible(true);
118116

119117
// stop the schedules here, so they don't run while the window is closed
120118
frame.addWindowListener(
@@ -124,6 +122,11 @@ public void windowClosing(java.awt.event.WindowEvent windowEvent) {
124122
timer.stop();
125123
}
126124
});
125+
126+
SwingUtilities.invokeLater(()-> {
127+
frame.pack();
128+
frame.setVisible(true);
129+
});
127130
}
128131

129132
/** Updates the field office list on the actual GUI. */

src/main/java/lol/hyper/customlauncher/invasiontracker/InvasionTracker.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,9 @@ public void showWindow() {
9898
timer.setDelay(500);
9999
timer.start();
100100

101-
frame.pack();
102101
frame.setSize(500, 400);
103102
frame.add(panel);
104103
frame.setLocationRelativeTo(null);
105-
frame.setVisible(true);
106104

107105
frame.addWindowListener(
108106
new java.awt.event.WindowAdapter() {
@@ -111,6 +109,11 @@ public void windowClosing(java.awt.event.WindowEvent windowEvent) {
111109
timer.stop();
112110
}
113111
});
112+
113+
SwingUtilities.invokeLater(()-> {
114+
frame.pack();
115+
frame.setVisible(true);
116+
});
114117
}
115118

116119
/** Updates the invasion list on the actual GUI. */

src/main/java/lol/hyper/customlauncher/login/windows/TwoFactorAuth.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ public void keyTyped(KeyEvent e) {
8989
}
9090
});
9191

92-
frame.setVisible(true);
9392
frame.add(panel);
9493
frame.setLocationRelativeTo(null);
94+
95+
SwingUtilities.invokeLater(()-> frame.setVisible(true));
9596
}
9697
}

src/main/java/lol/hyper/customlauncher/windows/ConfigWindow.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ public ConfigWindow(ConfigHandler configHandler) {
112112
showFieldOfficeNotifications.setBounds(20, 70, 100, 80);
113113
showFieldOfficeNotificationsBox.setBounds(120, 85, 100, 30);
114114

115-
frame.setVisible(true);
116115
frame.add(panel);
117116
frame.setLocationRelativeTo(null);
117+
118+
SwingUtilities.invokeLater(()-> frame.setVisible(true));
118119
}
119120
}

src/main/java/lol/hyper/customlauncher/windows/DeleteAccountWindow.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,13 @@ public void mouseClicked(MouseEvent evt) {
8282
}
8383
});
8484

85-
frame.pack();
8685
frame.setSize(300, 400);
87-
frame.setVisible(true);
8886
frame.add(panel);
8987
frame.setLocationRelativeTo(null);
88+
89+
SwingUtilities.invokeLater(()-> {
90+
frame.pack();
91+
frame.setVisible(true);
92+
});
9093
}
9194
}

src/main/java/lol/hyper/customlauncher/windows/MainWindow.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,12 @@ public void mouseClicked(MouseEvent evt) {
224224
});
225225

226226
frame.setSize(300, 450);
227-
frame.setVisible(true);
228227
frame.add(panel);
229228
frame.setLocationRelativeTo(null);
229+
230+
SwingUtilities.invokeLater(()-> {
231+
frame.setVisible(true);
232+
});
230233
}
231234

232235
/**

src/main/java/lol/hyper/customlauncher/windows/NewAccountWindow.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ public NewAccountWindow(MainWindow mainWindow) {
175175
});
176176

177177
frame.setVisible(true);
178-
frame.add(panel);
179178
frame.setLocationRelativeTo(null);
179+
180+
SwingUtilities.invokeLater(()-> {
181+
frame.setVisible(true);
182+
});
180183
}
181184
}

src/main/java/lol/hyper/customlauncher/windows/SecretPrompt.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ public SecretPrompt(Account account) {
9494
}
9595
});
9696

97-
frame.setVisible(true);
9897
frame.add(panel);
9998
frame.setLocationRelativeTo(null);
99+
100+
SwingUtilities.invokeLater(()-> frame.setVisible(true));
100101
}
101102
}

0 commit comments

Comments
 (0)