Occasional InterruptedException when quitting a Swing application

前端 未结 17 1138
心在旅途
心在旅途 2020-12-05 04:55

I recently updated my computer to a more powerful one, with a quad-core hyperthreading processor (i7), thus plenty of real concurrency available. Now I\'m occasionally

17条回答
  •  旧巷少年郎
    2020-12-05 05:28

    System.exit() probably isn't the cleanest way of closing down a Swing based app

    Can't you set your main frame to EXIT_ON_CLOSE:

    mainFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE )
    

    Then set it to invisible?

    Related Q here; System.exit(0) in java

提交回复
热议问题