I have a button that search some files, so I'm trying to display the progress of this task in a progress bar with percent numbers. I'm using another thread to execute this task, but it takes long time so I'd like to show it in a progress bar.
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Runnable r = new Runnable() {
public void run() {
//Process to search for files
}
};
Thread t = new Thread(r);
t.start();
}
});
Please help me, I don't have experience with the JProgressBar.