How to close a jframe without closing the main program

后端 未结 9 1868
天涯浪人
天涯浪人 2020-12-06 11:06

I\'m creating a program to keep track of a list of DVD\'s. On the main page I have set up 2 JButtons. When the user clicks the one that says new, a new JFrame from another c

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 11:31

    I think you can also use DISPOSE_ON_CLOSE:

    DISPOSE_ON_CLOSE (the default for JInternalFrame)

    Hide and dispose of the window when the user closes it. This removes the window from the screen and frees up any resources used by it.

提交回复
热议问题