Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8339178

[macos] Swing InterOp Platform.exit() crash

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • jfx24
    • jfx11, 8, jfx23
    • javafx

      It is possible to crash Swing by calling Platform.Exit()

      import javafx.application.Application;
      import javafx.application.Platform;
      import javafx.stage.Stage;

      import javax.swing.*;

      public class PlatformExitCrash extends Application {

          public static void main(String[] args) {
              SwingUtilities.invokeLater(PlatformExitCrash::createSwing);
              Application.launch(args);
          }

          private static void createSwing() {
              JDialog d = new JDialog();
              Platform.runLater(()-> {
                  Platform.exit();
              });
              try {
                  Thread.sleep(3000);
              } catch (InterruptedException e) {
              }
              d.setVisible(true);
          }

          @Override
          public void start(Stage st) {
          }
      }

            kcr Kevin Rushforth
            azvegint Alexander Zvegintsev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: