Example usage for javax.swing JFileChooser setAcceptAllFileFilterUsed

List of usage examples for javax.swing JFileChooser setAcceptAllFileFilterUsed

Introduction

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

Prototype

@BeanProperty(preferred = true, description = "Sets whether the AcceptAll FileFilter is used as an available choice in the choosable filter list.")
public void setAcceptAllFileFilterUsed(boolean b) 

Source Link

Document

Determines whether the AcceptAll FileFilter is used as an available choice in the choosable filter list.

Usage

From source file:com.swg.parse.docx.OpenWord.java

@Override
public void actionPerformed(ActionEvent e) {

    JFileChooser fc = new JFileChooser();
    fc.setCurrentDirectory(new File("C:/"));
    fc.setAcceptAllFileFilterUsed(false);
    //this authorize only .docx selection
    fc.addChoosableFileFilter(new DocxFileFilter());
    if (selectedFile != null) {
        fc.setSelectedFile(selectedFile);
    }/*www.  ja va  2s.co m*/
    int returnVal = fc.showDialog(WindowManager.getDefault().getMainWindow(), "Extract Data");

    if (returnVal == JFileChooser.APPROVE_OPTION) {

        File file = fc.getSelectedFile();
        selectedFile = file;

        pathToTxtFile = selectedFile.getAbsolutePath().replace(".docx", ".txt");
        TxtFile = new File(pathToTxtFile);

        String zipFilePath = "C:\\Users\\KXK3\\Documents\\ZipTest\\test.zip";
        String destDirectory = "C:\\Users\\KXK3\\Documents\\ZipTest\\temp";
        UnzipUtility unzipper = new UnzipUtility();
        try {
            File zip = new File(zipFilePath);
            File directory = new File(destDirectory);
            FileUtils.copyFile(selectedFile, zip);
            unzipper.UnzipUtility(zip, directory);

            String mediaPath = destDirectory + "/word/media/";
            File mediaDir = new File(mediaPath);

            for (File fil : mediaDir.listFiles()) {
                FileUtils.copyFile(fil,
                        new File("C:\\Users\\KXK3\\Documents\\ZipTest\\Pictures\\" + fil.getName()));
            }

            zip.delete();
            FileUtils.deleteDirectory(directory);

        } catch (Exception ex) {
            ex.printStackTrace();
        }

        //if the txt file doesn't exist, it tries to convert whatever 
        //can be the txt into the actual txt.
        if (!TxtFile.exists()) {
            pathToTxtFile = selectedFile.getAbsolutePath().replace(".docx", "");
            TxtFile = new File(pathToTxtFile);
            pathToTxtFile += ".txt";
            TxtFile.renameTo(new File(pathToTxtFile));
            TxtFile = new File(pathToTxtFile);
        }

        String content;
        String POIContent;

        try {
            content = readTxtFile();
            version = DetermineVersion(content);
            NewExtract ext = new NewExtract();
            ext.extract(content, selectedFile.getAbsolutePath(), version, 1);

        } catch (FileNotFoundException ex) {
            Exceptions.printStackTrace(ex);
        } catch (IOException ex) {
            Exceptions.printStackTrace(ex);
        } catch (ParseException ex) {
            Exceptions.printStackTrace(ex);
        }

    } else {
        //do nothing
    }

}

From source file:com.original.widget.OPicture.java

/**
 * very simple method to select an image file.
 * Please be advised that we will create our own file chooser in the
 * near future. Since in our system, people will be not encouraged to
 * access the physical file./*from   w w  w. j  a va  2 s.co m*/
 *
 * Of course, we need to discuss how to handle this issue.
 * @return
 */

private File chooseImgFile() {
    JFileChooser chooser = new JFileChooser(".");
    FileFilter imgType = new OriExtFileFilter("Image files", new String[] { ".jpg", ".gif", ".jpeg", ".png" });
    chooser.addChoosableFileFilter(imgType);
    chooser.setAcceptAllFileFilterUsed(false);
    chooser.setFileFilter(imgType);
    int status = chooser.showOpenDialog(null);
    if (status == JFileChooser.APPROVE_OPTION) {
        File f = chooser.getSelectedFile();
        return f;
    }
    return null;
}

From source file:com.naval.gui.Gui.java

private void creerPartie() {
    final JFileChooser fc = new JFileChooser(Config.getRepTravail());

    fc.addChoosableFileFilter(new GameFileFilter("gm", "Description de partie"));
    fc.setAcceptAllFileFilterUsed(false);

    int returnVal = fc.showOpenDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fc.getSelectedFile();

        // TODO : load only if game is !=

        try {/*from   w  w  w  . j av  a  2 s .co m*/
            FileReader fr = new FileReader(file);
            partie = Partie.creer(fr);
            partie.save();
            hintBar.setText("Partie " + partie.nom + " cre avec succes");
        } catch (FileNotFoundException e) {
            hintBar.setText(e.getMessage());
            e.printStackTrace();
        } catch (IOException e) {
            hintBar.setText(e.getMessage());
            e.printStackTrace();
        }
    }
}

From source file:com.naval.gui.Gui.java

private void chargerPartie() {
    final JFileChooser fc = new JFileChooser(Config.getRepTravail());

    fc.addChoosableFileFilter(new GameFileFilter("serial", "Sauv de partie"));
    fc.setAcceptAllFileFilterUsed(false);

    int returnVal = fc.showOpenDialog(frame);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
        File file = fc.getSelectedFile();

        // TODO : load only if game is !=
        try {// ww  w .  ja v a  2  s . c  o m
            partie = Partie.load(file.getAbsolutePath());

            menuFac.updateForLoad();
            update();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
            hintBar.setText(e.getMessage());
        } catch (IOException e) {
            hintBar.setText(e.getMessage());
            e.printStackTrace();

        } catch (ClassNotFoundException e) {
            hintBar.setText(e.getMessage());
            e.printStackTrace();
        }
    }
    if (partie.ordres == null || partie.ordres.size() == 0) {
        for (Navire n : partie.navires) {
            // creation des 3 ordres pour le tour courant.
            partie.ordres.add(new Ordre(n.id, partie.minute));
            partie.ordres.add(new Ordre(n.id, partie.minute));
            partie.ordres.add(new Ordre(n.id, partie.minute));

        }
    }
}

From source file:com.igormaznitsa.jhexed.swing.editor.ui.dialogs.hexeditors.DialogEditSVGImageValue.java

private void buttonLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonLoadActionPerformed
    final JFileChooser openDialog = new JFileChooser(lastOpenedFile);
    openDialog.setDialogTitle("Select SVG file");
    openDialog.setAcceptAllFileFilterUsed(true);
    openDialog.setFileFilter(Utils.SVG_FILE_FILTER);

    if (openDialog.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
        lastOpenedFile = openDialog.getSelectedFile();
        try {/*  w w w  .  j a  v  a  2  s . c om*/
            final SVGImage img = new SVGImage(lastOpenedFile);

            this.value.setImage(img);

            this.panelPreview.removeAll();
            this.panelPreview.add(
                    new JLabel(new ImageIcon(
                            img.rasterize(PREVIEW_SIZE, PREVIEW_SIZE, BufferedImage.TYPE_INT_ARGB))),
                    BorderLayout.CENTER);
            this.panelPreview.revalidate();
            this.panelPreview.repaint();

            this.buttonOk.setEnabled(true);
            this.buttonSaveAs.setEnabled(true);
        } catch (IOException ex) {
            Log.error("Can't rasterize image [" + lastOpenedFile + ']', ex);
            JOptionPane.showMessageDialog(this, "Can't load the file, may be it is not a SVG file",
                    "Can't load the file", JOptionPane.ERROR_MESSAGE);
        }
    }
}

From source file:carolina.pegaLatLong.LatLong.java

private void geraCsv(List<InformacaoGerada> gerados) throws IOException {
    JFileChooser escolha = new JFileChooser();
    escolha.setAcceptAllFileFilterUsed(false);
    escolha.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
    int i = escolha.showSaveDialog(null);
    if (i != 1) {
        System.err.println(escolha.getSelectedFile().getPath() + "\\teste.txt");
        String caminho = escolha.getSelectedFile().getPath();
        BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(
                new FileOutputStream(caminho + "\\teste.csv"), StandardCharsets.ISO_8859_1));
        //FileWriter arquivo = new FileWriter(caminho + "\\teste.csv");
        //PrintWriter writer = new PrintWriter(arquivo);
        writer.write("Endereco;Latitude;Longitude");
        writer.newLine();/*  ww w .j  a  v a 2  s  .  co  m*/

        gerados.stream().forEach((gerado) -> {
            try {
                System.err.println(gerado.getEnderecoFormatado() + ";" + gerado.getLatitude() + ";"
                        + gerado.getLongitude() + "\n");
                writer.write(gerado.getEnderecoFormatado() + ";" + gerado.getLatitude() + ";"
                        + gerado.getLongitude());
                writer.newLine();
            } catch (IOException ex) {
                System.err.println("Erro");
            }
        });

        writer.close();
        JOptionPane.showMessageDialog(null, "Finalizado!");

    }

}

From source file:com.genericworkflownodes.knime.nodes.io.OutputFileNodeDialog.java

/**
 * New pane for configuring MimeFileExporter node dialog.
 *//*from  w  w w. j a  v  a2s .  c o  m*/
public OutputFileNodeDialog(final String settingsName) {
    this.settingsName = settingsName;
    dialogPanel = new JPanel();
    componentContainer = new JPanel();
    textField = new JTextField();
    textField.setPreferredSize(new Dimension(300, textField.getPreferredSize().height));
    searchButton = new JButton("Browse");
    searchButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            final JFileChooser jfc = new JFileChooser();
            if (!"".equals(textField.getText().trim())
                    && new File(textField.getText().trim()).getParent() != null) {
                jfc.setCurrentDirectory(new File(textField.getText().trim()).getParentFile());
            }

            jfc.setAcceptAllFileFilterUsed(false);
            jfc.setFileFilter(extensionFilter);

            // int returnVal = jfc.showSaveDialog(dialogPanel);
            jfc.setFileSelectionMode(JFileChooser.FILES_ONLY);
            int returnVal = jfc.showDialog(dialogPanel, "Select output file");
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                // validate extension
                if (!extensionFilter.accept(jfc.getSelectedFile())) {
                    String message = "The selected output file has an invalid file extension.\n";
                    if (extensionFilter.getExtensions().length == 1) {
                        message += "Please choose a file with extension: " + extensionFilter.getExtensions()[0];
                    } else {
                        message += "Please choose a file with on of the following extensions: ";
                        message += StringUtils.join(extensionFilter.getExtensions(), ", ");
                    }
                    JOptionPane.showMessageDialog(getPanel(), message, "Selected Output File is invalid.",
                            JOptionPane.WARNING_MESSAGE);
                }
                textField.setText(jfc.getSelectedFile().getAbsolutePath());
            }
        }
    });
    setLayout();
    addComponents();

    addTab("Choose File", dialogPanel);
}

From source file:org.pgptool.gui.ui.importkey.KeyImporterPm.java

public MultipleFilesChooserDialog getSourceFileChooser() {
    if (sourceFileChooser == null) {
        sourceFileChooser = new MultipleFilesChooserDialog(findRegisteredWindowIfAny(), appProps,
                BROWSE_FOLDER) {//from  ww w.  j  av  a 2s.c  om
            @Override
            protected void doFileChooserPostConstruct(JFileChooser ofd) {
                super.doFileChooserPostConstruct(ofd);
                ofd.setDialogTitle(Messages.get("action.importKey"));

                ofd.setAcceptAllFileFilterUsed(false);
                ofd.addChoosableFileFilter(keyFilesFilter);
                ofd.addChoosableFileFilter(ofd.getAcceptAllFileFilter());
                ofd.setFileFilter(ofd.getChoosableFileFilters()[0]);
            }

            private FileFilter keyFilesFilter = new FileFilter() {
                @Override
                public boolean accept(File f) {
                    if (f.isDirectory() || !f.isFile()) {
                        return true;
                    }
                    if (!isExtension(f.getName(), EXTENSIONS)) {
                        return false;
                    }

                    // NOTE: Although it gives best results -- I have a
                    // slight concern that this might be too heavy operation
                    // to perform thorough -- check for each file
                    // contents. My hope is that since we're checking only
                    // key files it shouldn't be a problem. Non-key files
                    // with same xtensions will not take a long time to fail
                    try {
                        Key readKey = keyFilesOperations.readKeyFromFile(f.getAbsolutePath());
                        Preconditions.checkState(readKey != null, "Key wasn't parsed");

                        Key existingKey = keyRingService.findKeyById(readKey.getKeyInfo().getKeyId());
                        if (existingKey == null) {
                            return true;
                        }
                        if (!existingKey.getKeyData().isCanBeUsedForDecryption()
                                && readKey.getKeyData().isCanBeUsedForDecryption()) {
                            return true;
                        }
                        return false;
                    } catch (Throwable t) {
                        // in this case it's not an issue. So it's debug
                        // level
                        log.debug(
                                "File is not accepte for file chooser becasue was not able to read it as a key",
                                t);
                    }

                    return false;
                }

                private boolean isExtension(String fileName, String[] extensions) {
                    String extension = FilenameUtils.getExtension(fileName);
                    if (!StringUtils.hasText(extension)) {
                        return false;
                    }

                    for (String ext : extensions) {
                        if (ext.equalsIgnoreCase(extension)) {
                            return true;
                        }
                    }
                    return false;
                }

                @Override
                public String getDescription() {
                    return "Key files (.asc, .bpg)";
                }
            };
        };
    }
    return sourceFileChooser;
}

From source file:networkanalyzer.NetworkAnalyzer.java

private void browseMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_browseMouseClicked
    JFileChooser chooser = new JFileChooser();
    chooser.setCurrentDirectory(new java.io.File("."));
    chooser.setDialogTitle("Browse the folder to process");
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.setAcceptAllFileFilterUsed(true);

    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
        String fileName = chooser.getSelectedFile().toString();
        saveLoc.setText(fileName);/*  ww w. j  a v a2  s. c  om*/
    }

}

From source file:lu.lippmann.cdb.ext.hydviga.ui.GapsOverviewPanel.java

public void refresh(final Instances dataSet, final int dateIdx) {
    final Instances gapsDescriptionsDataset = GapsUtil.buildGapsDescription(gcp, dataSet, dateIdx);

    final JXTable gapsDescriptionsTable = new JXTable();
    final InstanceTableModel gapsDescriptionsTableModel = new InstanceTableModel(false);
    gapsDescriptionsTableModel.setDataset(gapsDescriptionsDataset);
    gapsDescriptionsTable.setModel(gapsDescriptionsTableModel);
    gapsDescriptionsTable.setEditable(true);
    gapsDescriptionsTable.setShowHorizontalLines(false);
    gapsDescriptionsTable.setShowVerticalLines(false);
    gapsDescriptionsTable.setVisibleRowCount(5);
    gapsDescriptionsTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    gapsDescriptionsTable.setSortable(false);
    gapsDescriptionsTable.packAll();//from  w w w . j  a v  a 2 s. co  m

    gapsDescriptionsTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    gapsDescriptionsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                int modelRow = gapsDescriptionsTable.getSelectedRow();
                if (modelRow < 0)
                    modelRow = 0;

                final String attrname = gapsDescriptionsTableModel.getValueAt(modelRow, 1).toString();
                final Attribute attr = dataSet.attribute(attrname);
                final int gapsize = (int) Double
                        .valueOf(gapsDescriptionsTableModel.getValueAt(modelRow, 5).toString()).doubleValue();
                final int position = (int) Double
                        .valueOf(gapsDescriptionsTableModel.getValueAt(modelRow, 6).toString()).doubleValue();

                try {
                    final ChartPanel cp = GapsUIUtil.buildGapChartPanel(dataSet, dateIdx, attr, gapsize,
                            position);

                    visualOverviewPanel.removeAll();
                    visualOverviewPanel.add(cp, BorderLayout.CENTER);

                    geomapPanel.removeAll();
                    geomapPanel.add(gcp.getMapPanel(Arrays.asList(attrname), new ArrayList<String>(), false));

                    jxp.updateUI();
                } catch (Exception ee) {
                    ee.printStackTrace();
                }
            }
        }
    });

    gapsDescriptionsTable.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseReleased(final MouseEvent e) {
            final InstanceTableModel instanceTableModel = (InstanceTableModel) gapsDescriptionsTable.getModel();
            final int row = gapsDescriptionsTable.rowAtPoint(e.getPoint());
            //final int row=gapsDescriptionsTable.getSelectedRow();
            final int modelRow = gapsDescriptionsTable.convertRowIndexToModel(row);
            //final int modelRow=(int)Double.valueOf(instanceTableModel.getValueAt(row,0).toString()).doubleValue();
            //System.out.println(row+" "+modelRow);

            final String attrname = instanceTableModel.getValueAt(modelRow, 1).toString();
            final Attribute attr = dataSet.attribute(attrname);
            final int gapsize = (int) Double.valueOf(instanceTableModel.getValueAt(modelRow, 5).toString())
                    .doubleValue();
            final int position = (int) Double.valueOf(instanceTableModel.getValueAt(modelRow, 6).toString())
                    .doubleValue();

            if (!e.isPopupTrigger()) {
                // nothing?
            } else {
                final JPopupMenu jPopupMenu = new JPopupMenu("feur");

                final JMenuItem interactiveFillMenuItem = new JMenuItem("Fill this gap (interactively)");
                interactiveFillMenuItem.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(final ActionEvent e) {
                        final GapFillingFrame jxf = new GapFillingFrame(atv, dataSet, attr, dateIdx,
                                GapsUtil.getCountOfValuesBeforeAndAfter(gapsize), position, gapsize, gcp,
                                false);
                        jxf.setSize(new Dimension(900, 700));
                        //jxf.setExtendedState(Frame.MAXIMIZED_BOTH);                        
                        jxf.setLocationRelativeTo(jPopupMenu);
                        jxf.setVisible(true);
                        //jxf.setResizable(false);
                    }
                });
                jPopupMenu.add(interactiveFillMenuItem);

                final JMenuItem lookupInKnowledgeDBMenuItem = new JMenuItem(
                        "Show the most similar cases from KnowledgeDB");
                lookupInKnowledgeDBMenuItem.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(final ActionEvent e) {
                        final double x = gcp.getCoordinates(attrname)[0];
                        final double y = gcp.getCoordinates(attrname)[1];
                        final String season = instanceTableModel.getValueAt(modelRow, 3).toString()
                                .split("/")[0];
                        final boolean isDuringRising = instanceTableModel.getValueAt(modelRow, 11).toString()
                                .equals("true");
                        try {
                            final Calendar cal = Calendar.getInstance();
                            final String dateAsString = instanceTableModel.getValueAt(modelRow, 2).toString()
                                    .replaceAll("'", "");
                            cal.setTime(FormatterUtil.DATE_FORMAT.parse(dateAsString));
                            final int year = cal.get(Calendar.YEAR);

                            new SimilarCasesFrame(dataSet, dateIdx, gcp, attrname, gapsize, position, x, y,
                                    year, season, isDuringRising);
                        } catch (Exception e1) {
                            e1.printStackTrace();
                        }
                    }
                });
                jPopupMenu.add(lookupInKnowledgeDBMenuItem);

                final JMenuItem mExport = new JMenuItem("Export this table as CSV");
                mExport.addActionListener(new ActionListener() {
                    @Override
                    public void actionPerformed(final ActionEvent e) {
                        final JFileChooser fc = new JFileChooser();
                        fc.setAcceptAllFileFilterUsed(false);
                        final int returnVal = fc.showSaveDialog(gapsDescriptionsTable);
                        if (returnVal == JFileChooser.APPROVE_OPTION) {
                            try {
                                final File file = fc.getSelectedFile();
                                WekaDataAccessUtil.saveInstancesIntoCSVFile(gapsDescriptionsDataset, file);
                            } catch (Exception ee) {
                                ee.printStackTrace();
                            }
                        }
                    }
                });
                jPopupMenu.add(mExport);

                jPopupMenu.show(gapsDescriptionsTable, e.getX(), e.getY());
            }
        }
    });

    final int tableWidth = (int) gapsDescriptionsTable.getPreferredSize().getWidth() + 30;
    final JScrollPane scrollPane = new JScrollPane(gapsDescriptionsTable);
    scrollPane.setPreferredSize(new Dimension(Math.min(tableWidth, 500), 500));
    scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    this.tablePanel.removeAll();
    this.tablePanel.add(scrollPane, BorderLayout.CENTER);

    this.visualOverviewPanel.removeAll();

    /* automatically compute the most similar series and the 'rising' flag */
    new AbstractSimpleAsync<Void>(false) {
        @Override
        public Void execute() throws Exception {
            final int rc = gapsDescriptionsTableModel.getRowCount();
            for (int i = 0; i < rc; i++) {
                final int modelRow = i;

                try {
                    final String attrname = gapsDescriptionsTableModel.getValueAt(modelRow, 1).toString();
                    final Attribute attr = dataSet.attribute(attrname);
                    final int gapsize = (int) Double
                            .valueOf(gapsDescriptionsTableModel.getValueAt(modelRow, 5).toString())
                            .doubleValue();
                    final int position = (int) Double
                            .valueOf(gapsDescriptionsTableModel.getValueAt(modelRow, 6).toString())
                            .doubleValue();

                    /* most similar */
                    gapsDescriptionsTableModel.setValueAt("...", modelRow, 7);
                    final int cvba = GapsUtil.getCountOfValuesBeforeAndAfter(gapsize);
                    Instances gapds = WekaDataProcessingUtil.buildFilteredDataSet(dataSet, 0,
                            dataSet.numAttributes() - 1, Math.max(0, position - cvba),
                            Math.min(position + gapsize + cvba, dataSet.numInstances() - 1));
                    final String mostsimilar = WekaTimeSeriesSimilarityUtil.findMostSimilarTimeSerie(gapds,
                            attr, WekaTimeSeriesUtil.getNamesOfAttributesWithoutGap(gapds), false);
                    gapsDescriptionsTableModel.setValueAt(mostsimilar, modelRow, 7);

                    /* 'rising' flag */
                    gapsDescriptionsTableModel.setValueAt("...", modelRow, 11);
                    final List<String> attributeNames = WekaDataStatsUtil.getAttributeNames(dataSet);
                    attributeNames.remove("timestamp");
                    final String nearestStationName = gcp.findNearestStation(attr.name(), attributeNames);
                    final Attribute nearestStationAttr = dataSet.attribute(nearestStationName);
                    //System.out.println(nearestStationName+" "+nearestStationAttr);
                    final boolean isDuringRising = GapsUtil.isDuringRising(dataSet, position, gapsize,
                            new int[] { dateIdx, attr.index(), nearestStationAttr.index() });
                    gapsDescriptionsTableModel.setValueAt(isDuringRising, modelRow, 11);

                    gapsDescriptionsTableModel.fireTableDataChanged();
                } catch (Exception e) {
                    gapsDescriptionsTableModel.setValueAt("n/a", modelRow, 7);
                    gapsDescriptionsTableModel.setValueAt("n/a", modelRow, 11);
                    e.printStackTrace();
                }
            }
            return null;
        }

        @Override
        public void onSuccess(Void result) {
        }

        @Override
        public void onFailure(Throwable caught) {
            caught.printStackTrace();
        }

    }.start();

    /* select the first row */
    gapsDescriptionsTable.setRowSelectionInterval(0, 0);
}