class FileArgument extends AbstractArgument {

    /**
     * a filter to put on the FileChooser.
     */
    protected FileFilter filter;
    /**
     * indicates if the argument has to point to a new or an existing file.
     */
    protected boolean newFile;
    /**
     * the label
     */
    PdfInformationPanel label = null;

    public FileArgument() {
        super();
    }

    /**
     * Constructs a FileArgument.
     *
     * @param tool        the tool that needs this argument
     * @param name        the name of the argument
     * @param description the description of the argument
     * @param newFile     makes the difference between an Open or Save dialog
     * @param filter      FileFilter
     */
    public FileArgument(AbstractTool tool, String name, String description,
            boolean newFile, FileFilter filter) {
        super(tool, name, description, null);
        this.newFile = newFile;
        this.filter = filter;
    }

    /**
     * Constructs a FileArgument.
     *
     * @param tool        the tool that needs this argument
     * @param name        the name of the argument
     * @param description the description of the argument
     * @param newFile     makes the difference between an Open or Save dialog
     */
    public FileArgument(AbstractTool tool, String name, String description,
            boolean newFile) {
        this(tool, name, description, newFile, null);
    }

    /**
     * Gets the argument as an object.
     *
     * @return an object
     * @throws InstantiationException if the specified key cannot be compared with the keys currently in the map
     */
    public Object getArgument() throws InstantiationException {
        if (value == null) {
            return null;
        }
        try {
            return new File(value.toString());
        } catch (Exception e) {
            throw new InstantiationException(e.getMessage());
        }
    }

    /**
     * @param e ActionEvent
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent e) {<FILL_FUNCTION_BODY>}

    /**
     * @return Returns the filter.
     */
    public FileFilter getFilter() {
        return filter;
    }

    /**
     * @param filter The filter to set.
     */
    public void setFilter(FileFilter filter) {
        this.filter = filter;
    }

    /**
     * @return Returns the label.
     */
    public PdfInformationPanel getLabel() {
        return label;
    }

    /**
     * @param label The label to set.
     */
    public void setLabel(PdfInformationPanel label) {
        this.label = label;
    }

}

        JFileChooser fc = new JFileChooser();

        if (filter != null) {
            fc.setFileFilter(filter);
            if (filter instanceof DirFilter) {
                fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            }
        }
        if (label != null) {
            fc.setAccessory(label);
            fc.addPropertyChangeListener(
                    JFileChooser.SELECTED_FILE_CHANGED_PROPERTY, label);
        }
        if (newFile) {
            fc.showSaveDialog(tool.getInternalFrame());
        } else {
            fc.showOpenDialog(tool.getInternalFrame());
        }
        try {
            setValue(fc.getSelectedFile());
        } catch (NullPointerException npe) {
        }
    
<methods>public void <init>() ,public void <init>(com.lowagie.toolbox.AbstractTool, java.lang.String, java.lang.String, java.lang.Object) ,public abstract void actionPerformed(java.awt.event.ActionEvent) ,public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener) ,public java.lang.Object getArgument() throws java.lang.InstantiationException,public java.lang.String getDescription() ,public java.lang.String getName() ,public com.lowagie.toolbox.AbstractTool getTool() ,public java.lang.String getUsage() ,public java.lang.Object getValue() ,public void propertyChange(java.beans.PropertyChangeEvent) ,public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener) ,public void setDescription(java.lang.String) ,public void setName(java.lang.String) ,public void setTool(com.lowagie.toolbox.AbstractTool) ,public void setValue(java.lang.Object) ,public void setValue(java.lang.Object, java.lang.String) ,public java.lang.String toString() <variables>protected java.lang.String description,protected java.lang.String name,protected java.beans.PropertyChangeSupport pcs,protected com.lowagie.toolbox.AbstractTool tool,protected java.lang.Object value