Answer the question
In order to leave comments, you need to log in
How can I make the first window not close when the second one is closed?
I create the main window, I placed a button on it, by pressing which a new window is created.
jButtonSee.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
tableClass table = new tableClass();
}
});
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);
}
Answer the question
In order to leave comments, you need to log in
I'll add the main window to main:
public static void main(String[] args){
new frameClass();
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question