Is there a way to terminate a java application that uses java3d, without calling System.exit()?

前端 未结 2 752
自闭症患者
自闭症患者 2021-02-19 09:49

Java3D starts several system threads and doesn\'t set the isDaemon flag on them. When I dispose the (only) JFrame of my application it won\'t terminate because these threads are

2条回答
  •  醉酒成梦
    2021-02-19 10:12

    System.exit(0) is correct way to end program.

    It's convenient way to handle shutdown in program, where parts of the program can't be aware of each other. Then, if some part wants to quit, he can simply call System.exit(), and the shutdown hooks take care of doing all necessary shutdown tasks such as: closing files, dispose opened windows, and releasing resources.

    Read the docu about shutdown hooks.

提交回复
热议问题