I am trying to get the size of a file from JFileChooser so that I can print it in table, how do I do that?
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
String[] fileNames = fileChooser.getSelectedFile().list();
int fileSize;
for (int i = 0; i < files.length; i++) {
int fileSize = fileNames[i] //How do I get the size of the file here?
model.addRow(new Object[]{fileNames[i], fileSize});
}