Search in sources :

Example 51 with FileNameExtensionFilter

use of javax.swing.filechooser.FileNameExtensionFilter in project beast-mcmc by beast-dev.

the class BeautiFrame method doImport.

public final void doImport() {
    File[] files = selectImportFiles("Import Aligment...", true, new FileNameExtensionFilter[] { new FileNameExtensionFilter("Microsatellite (tab-delimited *.txt) Files", "txt"), new FileNameExtensionFilter("NEXUS, BEAST or FASTA Files", "nex", "nexus", "nx", "xml", "beast", "fa", "fasta", "afa") });
    // new FileNameExtensionFilter( "Microsatellite (tab-delimited *.txt) Files", "txt");
    if (files != null && files.length != 0) {
        importFiles(files);
        tabbedPane.setSelectedComponent(dataPanel);
    }
}
Also used : FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter)

Example 52 with FileNameExtensionFilter

use of javax.swing.filechooser.FileNameExtensionFilter in project opentheso by miledrousset.

the class BaseDeDonnesBean method inyectionaBDD.

/**
 * @throws ClassNotFoundException
 * @throws SQLException
 */
public void inyectionaBDD() throws ClassNotFoundException, SQLException {
    File fichero;
    importxml impo = new importxml();
    JFileChooser fileChooser = new JFileChooser();
    FileNameExtensionFilter ft = new FileNameExtensionFilter("*.xml", "xml");
    fileChooser.setVisible(true);
    fileChooser.setFileFilter(ft);
    int seleccion = fileChooser.showOpenDialog(null);
    if (seleccion == JFileChooser.APPROVE_OPTION) {
        fichero = fileChooser.getSelectedFile();
        impo.ouvreFichier2(connect.getPoolConnexion(), fichero);
    }
}
Also used : mom.trd.opentheso.core.exports.privatesdatas.importxml.importxml(mom.trd.opentheso.core.exports.privatesdatas.importxml.importxml) JFileChooser(javax.swing.JFileChooser) FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) File(java.io.File)

Aggregations

FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)52 File (java.io.File)32 JFileChooser (javax.swing.JFileChooser)30 FileFilter (javax.swing.filechooser.FileFilter)15 IOException (java.io.IOException)11 Preferences (java.util.prefs.Preferences)7 FileNotFoundException (java.io.FileNotFoundException)6 PCGFile (pcgen.io.PCGFile)6 ResourceBundle (java.util.ResourceBundle)5 SwingWorker (javax.swing.SwingWorker)5 FileOutputStream (java.io.FileOutputStream)3 PCGenSettings (pcgen.system.PCGenSettings)3 ImportException (dr.evolution.io.Importer.ImportException)2 MissingBlockException (dr.evolution.io.NexusImporter.MissingBlockException)2 java.awt (java.awt)2 BorderLayout (java.awt.BorderLayout)2 Cursor (java.awt.Cursor)2 Dimension (java.awt.Dimension)2 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2