How would one go about creating a uploadFile method in Java that has a GUI? for example I am trying to use JFileChooser to execute a selected file in which I can click on the file and call the file and pass it into a file then send it out as a fileInputStream so looking at the code cause its a lot easier to explain.
Something like this..
JFileChooser fc = new JFileChooser();
fc.getSelectedFile();
File inputFile = fc.getSelectedFile();
FileInputStream inputStream = new FileInputStream(inputFile);
try {
DbxEntry.File uploadedFile = client.uploadFile("/javaroots.jpg",
DbxWriteMode.add(), inputFile.length(), inputStream);
String sharedUrl = client.createShareableUrl("/javaroots.jpg");
System.out.println("Uploaded: " + uploadedFile.toString() + " URL " + sharedUrl);
} finally {
inputStream.close();
}
}