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:38

    To hide the window without it actually closing the program, do:

    f.setVisible(false);
    

提交回复
热议问题