public void setUpFile() {
    removeAll();
    m_fileChooser.setFileFilter(new FileFilter() { 
      public boolean accept(File f) { 
        return f.isDirectory();
      }
      public String getDescription() {
        return "Directory";
      }
    });

    m_fileChooser.setAcceptAllFileFilterUsed(false);

    try{
      if (!m_smSaver.getDirectory().getPath().equals("")) {
       // File tmp = m_smSaver.getDirectory();
        String dirStr = m_smSaver.getDirectory().toString();
        if (Environment.containsEnvVariables(dirStr)) {
          try {
            dirStr = m_env.substitute(dirStr);
          } catch (Exception ex) {
            // ignore
          }
        }
        File tmp = new File(dirStr);;
        tmp = new File (tmp.getAbsolutePath());
        m_fileChooser.setCurrentDirectory(tmp);
      }
    } catch(Exception ex) {
      System.out.println(ex);
    }

    JPanel innerPanel = new JPanel();
    innerPanel.setLayout(new BorderLayout());
    
    JPanel alignedP = new JPanel();
    GridBagLayout gbLayout = new GridBagLayout();
    alignedP.setLayout(gbLayout);
    
    JLabel prefixLab = new JLabel("Prefix for file name", SwingConstants.RIGHT);
    prefixLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    GridBagConstraints gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 0; gbConstraints.gridx = 0;
    gbLayout.setConstraints(prefixLab, gbConstraints);
    alignedP.add(prefixLab);
    
//    m_prefixText = new JTextField(m_smSaver.getPrefix(), 25);
    m_prefixText = new EnvironmentField();
    m_prefixText.setEnvironment(m_env);
/*    int width = m_prefixText.getPreferredSize().width;
    int height = m_prefixText.getPreferredSize().height;
    m_prefixText.setMinimumSize(new Dimension(width * 2, height));
    m_prefixText.setPreferredSize(new Dimension(width * 2, height)); */
    m_prefixText.setText(m_smSaver.getPrefix());
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 0; gbConstraints.gridx = 1;
    gbLayout.setConstraints(m_prefixText, gbConstraints);
    alignedP.add(m_prefixText);
    
    JLabel ffLab = new JLabel("File format", SwingConstants.RIGHT);
    ffLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 1; gbConstraints.gridx = 0;
    gbLayout.setConstraints(ffLab, gbConstraints);
    alignedP.add(ffLab);
    
    setUpFileFormatComboBox();
    m_fileFormatBox.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 1; gbConstraints.gridx = 1;
    gbLayout.setConstraints(m_fileFormatBox, gbConstraints);
    alignedP.add(m_fileFormatBox);

    JPanel about = m_SaverEditor.getAboutPanel();
    if (about != null) {
      innerPanel.add(about, BorderLayout.NORTH);
    }
    add(innerPanel, BorderLayout.NORTH);
    
    JLabel directoryLab = new JLabel("Directory", SwingConstants.RIGHT);
    directoryLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 2; gbConstraints.gridx = 0;
    gbLayout.setConstraints(directoryLab, gbConstraints);
    alignedP.add(directoryLab);
    
    m_directoryText = new EnvironmentField();
    m_directoryText.setEnvironment(m_env);  
/*    width = m_directoryText.getPreferredSize().width;
    height = m_directoryText.getPreferredSize().height;
    m_directoryText.setMinimumSize(new Dimension(width * 2, height));
    m_directoryText.setPreferredSize(new Dimension(width * 2, height)); */
    
    m_directoryText.setText(m_smSaver.getDirectory().toString());
    
    JButton browseBut = new JButton("Browse...");
    browseBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {
          final JFrame jf = new JFrame("Choose directory");
          jf.getContentPane().setLayout(new BorderLayout());
          jf.getContentPane().add(m_fileChooser, BorderLayout.CENTER);
          jf.pack();
          jf.setVisible(true);
          m_fileChooserFrame = jf;
        } catch (Exception ex) {
          ex.printStackTrace();
        }
      }
    });
    
    JPanel efHolder = new JPanel();
    efHolder.setLayout(new BorderLayout());
    JPanel bP = new JPanel(); bP.setLayout(new BorderLayout());
    bP.setBorder(BorderFactory.createEmptyBorder(5,0,5,5));
    bP.add(browseBut, BorderLayout.CENTER);
    efHolder.add(bP, BorderLayout.EAST);
    efHolder.add(m_directoryText, BorderLayout.CENTER);
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 2; gbConstraints.gridx = 1;
    gbConstraints.weightx = 5; // make sure that extra horizontal space gets allocated to this column
    gbLayout.setConstraints(efHolder, gbConstraints);
    alignedP.add(efHolder);

    
    JLabel relativeLab = new JLabel("Use relative file paths", SwingConstants.RIGHT);
    relativeLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 3; gbConstraints.gridx = 0;
    gbLayout.setConstraints(relativeLab, gbConstraints);
    alignedP.add(relativeLab);
    
    m_relativeFilePath = new JCheckBox();
    m_relativeFilePath.
      setSelected(m_smSaver.getUseRelativePath());

    m_relativeFilePath.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          m_smSaver.setUseRelativePath(m_relativeFilePath.isSelected());
        }
      });
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 3; gbConstraints.gridx = 1;
    gbLayout.setConstraints(m_relativeFilePath, gbConstraints);
    alignedP.add(m_relativeFilePath);
    
    
    JLabel relationLab = new JLabel("Include relation name in file name", SwingConstants.RIGHT);
    relationLab.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 4; gbConstraints.gridx = 0;
    gbLayout.setConstraints(relationLab, gbConstraints);
    alignedP.add(relationLab);
    
    m_includeRelationName = new JCheckBox();
    m_includeRelationName.setToolTipText("Include the relation name of the training data used "
        + "to create the model in the file name.");
    m_includeRelationName.setSelected(m_smSaver.getIncludeRelationName());
        
    gbConstraints = new GridBagConstraints();
    gbConstraints.anchor = GridBagConstraints.EAST;
    gbConstraints.fill = GridBagConstraints.HORIZONTAL;
    gbConstraints.gridy = 4; gbConstraints.gridx = 1;
    gbLayout.setConstraints(m_includeRelationName, gbConstraints);
    alignedP.add(m_includeRelationName);
    
    JButton OKBut = new JButton("OK");
    OKBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        try {          
          m_smSaver.setPrefix(m_prefixText.getText());
          m_smSaver.setDirectory(new File(m_directoryText.getText()));
          m_smSaver.
            setIncludeRelationName(m_includeRelationName.isSelected());
        } catch (Exception ex) {
          ex.printStackTrace();
        }
        
        m_parentFrame.dispose();
      }
    });

    JButton CancelBut = new JButton("Cancel");
    CancelBut.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        m_parentFrame.dispose();
      }
    });
    
    JPanel butHolder = new JPanel();
    butHolder.setLayout(new FlowLayout());
    butHolder.add(OKBut);
    butHolder.add(CancelBut);
  
    JPanel holderPanel = new JPanel();
    holderPanel.setLayout(new BorderLayout());
    holderPanel.add(alignedP, BorderLayout.NORTH);
    holderPanel.add(butHolder, BorderLayout.SOUTH);
    add(holderPanel, BorderLayout.SOUTH);
  }