Skip to content

Commit

Permalink
trying to fix disposeViewerWindow()
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanPreibisch committed Sep 7, 2024
1 parent b1086b3 commit 1941962
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ public static void disposeViewerWindow( final BigDataViewer bdv )
{
try
{
new Thread( () ->
{
final ViewerFrame frame = bdv.getViewerFrame();
final WindowEvent windowClosing = new WindowEvent( frame, WindowEvent.WINDOW_CLOSING );
frame.dispatchEvent( windowClosing );
}).start();

/*
// error: Exception in thread "AWT-EventQueue-0" java.lang.Error: Cannot call invokeAndWait from the event dispatcher thread
SwingUtilities.invokeAndWait( new Runnable()
{
@Override
Expand All @@ -249,6 +258,7 @@ public void run()
frame.dispatchEvent( windowClosing );
}
} );
*/
}
catch ( final Exception e )
{}
Expand Down

0 comments on commit 1941962

Please sign in to comment.