Skip to content

Commit

Permalink
Try without relocating the dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Nov 21, 2024
1 parent f97a55b commit 13a6c71
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2010,7 +2010,7 @@ public Object audit(Object message, Object conditionOrOptionList, Object optionL
* Refresh the screen, then delay for the specified number of milliseconds
*
* This is not pretty, but is the only way I have found to force a proper UI refresh
* - Open a modal dialog box way offscreen. This forces an actual real Swing UI refresh, then hangs the UI
* - Open a modal dialog box way off-screen. This forces an actual real Swing UI refresh, then hangs the UI
* - Start a new thread that closes the dialog box after a specified delay
*
* @param ms Milliseconds to delay
Expand All @@ -2021,10 +2021,9 @@ public Object sleep(Object ms, PropertySource ps) {

final int milliSeconds = IntPropValue(ms);
final JDialog dialog = new JDialog(GameModule.getGameModule().getPlayerWindow(), true);

dialog.setLocation(-5000, -5000); // Like as not, the OS will put the window in top leftmost position
// dialog.setLocation(-5000, -5000); // Like as not, the OS will put the window in top leftmost position
dialog.setUndecorated(true); // keeps the dialog box invisible by virtue of zero content, making relocation redundant (?)
SwingUtilities.invokeLater(new DialogCloser(dialog, milliSeconds));
dialog.setUndecorated(true); // keeps the dialog box invisible by virtue of zero content.
dialog.setVisible(true);
return "";
}
Expand Down

0 comments on commit 13a6c71

Please sign in to comment.