Example usage for javax.swing JFileChooser repaint

List of usage examples for javax.swing JFileChooser repaint

Introduction

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

Prototype

public void repaint() 

Source Link

Document

Repaints this component.

Usage

From source file:app.RunApp.java

/**
 * Action of Choose file button on Principal tab
 * /*from   w w w.  j a v  a 2  s. c o  m*/
 * @param evt Event
 */
private void buttonChooseFileActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonChooseFileActionPerformed
    final JFileChooser jfile1 = new JFileChooser();
    jfile1.setLocale(Locale.UK);
    jfile1.repaint();
    FileNameExtensionFilter fname = new FileNameExtensionFilter(".arff", "arff");
    jfile1.setFileFilter(fname);

    final boolean deleteXML = false;

    final int returnVal = jfile1.showOpenDialog(this);

    progressBar.setIndeterminate(true);
    progressFrame.setVisible(true);
    progressFrame.repaint();

    new Thread(new Runnable() {
        @Override
        public void run() {
            // do the long-running work here
            loadDataset(returnVal, jfile1, deleteXML);
            // at the end:
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    progressBar.setIndeterminate(false);
                    progressFrame.setVisible(false);
                    progressFrame.repaint();
                }//run
            }); //invokeLater
        }
    }).start();
}