How to open a new window by clicking a button

前端 未结 2 519
忘掉有多难
忘掉有多难 2021-02-14 06:26

As a part of my program, I need to have a button that when the user click on it, it opens a new window.

Well I guess I should have a class that make the frame and call i

2条回答
  •  闹比i
    闹比i (楼主)
    2021-02-14 07:23

    new CLASS_NAME().setVisible(true);
    

    eg. new NewJFrame().setVisible(true);

提交回复
热议问题