How to make the first window not closed after closing the second??

Create the main window, it had a button which creates a new window.
jButtonSee.addActionListener(new ActionListener() {
@Override
 public void actionPerformed(ActionEvent e) {
 tableClass table = new tableClass();
}
 });

How do I make the first window not closed??
Code window the second window. The first is the same, only with the button:
public tableClass(){
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);
 setSize(new Dimension(500, 500));
setTitle("JTable");
 setLayout(new FlowLayout());

 JTable jTable = new JTable();
 JScrollPane jScrollPane = new JScrollPane(jTable);
 jScrollPane.setSize(450, 400);
setVisible(true);
 }
July 2nd 19 at 18:15
1 answer
July 2nd 19 at 18:17
Solution
Add main window in main:
public static void main(String[] args){
 new frameClass();
 }


Solved your problem, the first window is a JFrame.EXIT_ON_CLOSE and the second window the JFrame.DISPOSE_ONCLOSE

Find more questions by tags Java