Question: 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?

Answer: 
It is not that the JFrame is not visible, but rather it was never *set to be visible*. I assume you want the JFrame to be visible when the **showSaveDialog()** is called. Due to the lack of detail, this is what I have to offer:  

```
    javax.swing.JFrame frame = new javax.swing.JFrame();
    frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);

    javax.swing.JPanel panel = new javax.swing.JPanel();
    panel.setPreferredSize(new java.awt.Dimension(150,150) );

    javax.swing.JFileChooser chooseFile = new javax.swing.JFileChooser(); frame.getContentPane().add(java.awt.BorderLayout.CENTER,panel);

    frame.setSize(400,400);
    frame.setVisible(true);
    chooseFile.showSaveDialog(panel);

```

EDIT: I reread your question and have the idea that you may want to place the JFileChooser on the panel for the question is ambiguous. You may have wanted this:

```
    javax.swing.JFrame frame = new javax.swing.JFrame();
    frame.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
    javax.swing.JPanel panel = new javax.swing.JPanel();
    panel.setPreferredSize(new java.awt.Dimension(150,150) );
    javax.swing.JFileChooser chooseFile = new javax.swing.JFileChooser(); frame.getContentPane().add(java.awt.BorderLayout.CENTER,panel);
    chooseFile.setPreferredSize(new java.awt.Dimension(400, 400));
    frame.setSize(400,440);
    frame.setVisible(true);
    panel.add(chooseFile);<br><br>

```
The save dialog FileChooser is a modal dialog. This means that when we call `chooseFile.showSaveDialog(panel);` the file dialog is given focus and the user cannot interact with the panel until the dialog is closed. This is usually the behavior we want.

If we want to create some sort of file manager, then maybe you want to try adding the JFileChooser to your panel instead. Since JFileChooser extends component, you can do this, but it requires a bit more code and more of understanding of swing. This [SO question](https://stackoverflow.com/questions/259575/jfilechooser-embedded-in-a-jpanel) addresses adding a JFileChooser to JPanel.