I would like to know how I can show the output from this piece of 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());
}
}
I want to open this in a JTextArea after clicking the JMenuItem in a JMenu
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {
//code for Output
}
Could someone please help me to achieve this.
wont this do the trick?:
you had the exact code just had to move your method to menu items actionPerformed() method unless i misunderstood the question?