I have an assignment regarding Java NIO and Thread. I should write a program with these four important abilities: copy, cut, rename, and delete. I made 4 classes for each part of project. All of them extend Runnable
and in the run I used some code like this:
fc = new JFileChooser();
fc.showOpenDialog(Copy.this);
File f1 = fc.getSelectedFile();
fc.showOpenDialog(Copy.this);
File f2 = fc.getSelectedFile();
if(copyFile(f1, f2)){
System.out.println("File Copied");
}
fc
is a JFileChooser
class field and I have a mainFrame
that have 4 buttons and each one starts a threat from each class. I do not know about my way and I have no idea what it should be like. I've watched two videos about multi-threading and I have no idea how this program can be a deadlock or how it can have problems running, and my biggest problem is that I want to have JProgressBar
in file copying, file deleting and file cutting and I have no idea about how can I know about these levels in the program to do the best with JProgressBar
.
it is the whole project : https://www.mediafire.com/?yyw8jg1xncfp2xn