Example usage for javax.swing JFileChooser getComponent

List of usage examples for javax.swing JFileChooser getComponent

Introduction

In this page you can find the example usage for javax.swing JFileChooser getComponent.

Prototype

public Component getComponent(int n) 

Source Link

Document

Gets the nth component in this container.

Usage

From source file:forms.FormFluxodeCaixa.java

public void Excel() {

    JFileChooser fileChooser = new JFileChooser();

    if (fileChooser.showSaveDialog(fileChooser.getComponent(0)) == JFileChooser.APPROVE_OPTION) { //Exibe janela onde salvar o arquivo HTML

        File file = fileChooser.getSelectedFile(); //Pega o caminho completo

        String caminho;//www  .  j a va  2  s .  c om
        if (file.getPath().contains(".xls")) {

            caminho = file.getPath();

        } else {
            caminho = file.getPath() + ".xls";

        }

        new ExportacaoParaExcel().Exportar(caminho, dataInicial, dataFinal,
                FiltroData.values()[comboFiltroData.getSelectedIndex()]);

    }

}