Hi there, hope you can help me, this is a program made in Netbeans.
In the attached image, I have a JMenuItem called "Listagem de ficheiros" with an ActionEvent.
guj.jpg
I want to click on it and open a jTextArea that returns the output of next code:
1 - i can't make it open a jTextArea to show the output.PHP Code:
File folder = new File("C:\\Users\\Hugo Monteiro\\Documents\\NetBeansProjects\\FileImporter\\ImagensDB");
File[] listOfFiles = folder.listFiles();
for (int i=0; i<listOfFiles.length; i++) {
if (listOfFiles[i].isFile()) {
jTextArea1.append("File: " +listOfFiles[i].getName().split("-"));
}
}
2 - It doesn't split the file name
normal Output: 001-A Retro Autumn-Garnett Rules-MAI2012-24.45-Landscapes.jpg
What i want: 001 A Retro Autumn Garnett Rules MAI2012 24.45 Landscapes.jpg
Thanks in advance.