Why in the swing by default the application does not end when you click on the cross?

    1 answer 1

    Because it is so defined in JFrame:

     private int defaultCloseOperation = HIDE_ON_CLOSE; 
    • Why is it so defined? - user232141
    • @ user232141: Well, somehow it was necessary to determine? Here the developers threw a coin and decided. - VladD
    • @VladD is not an obvious solution, for example, for windows users, there must be some compelling reasons - user232141
    • @VladD in the end, it was possible to enter an undefined state - user232141
    • @ user232141: Well, the undefined state is worse: the “default” state should be the most “correct”. Why swing developers considered HIDE_ON_CLOSE most correct, probably, only they know. - VladD