class ImprovedFileChooser extends JFileChooser {

  @Override
  public int showDialog(Component parent, String approveButtonText) throws HeadlessException {
    int returnValue = super.showDialog(parent, approveButtonText);
    this.dialog = null; // dialog was disposed in super-method. Null out so we don't try to use it.
    return returnValue;
  }

  public  ImprovedFileChooser();
  public  ImprovedFileChooser(File currentDirectory);
  public  ImprovedFileChooser(File currentDirectory, FileSystemView fsv);

}