I'm doing a mini-program in Java, that would manage files in the computer. I tried put the JFileChooser.showSaveDialog() in the middle of the frame, by creating a panel and put it in the middle of the frame :
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
panel.setPreferredSize(new Dimension(150,150) );
JFileChooser chooseFile = new JFileChooser();
chooseFile.showSaveDialog(panel);
frame.getContentPane().add(BorderLayout.CENTER,panel);
frame.setSize(400,400);
frame.setVisible(true);
But actually, when the showSaveDialog() command happens, the frame becomes not visible. Can I change it?