I have files in a directory.
I would like to know if it’s possible to create a table with the list of the files (only the name) and the data of creation? But in each line of the table, a button to open the file of this line.
Basically, a table with 3 columns (name, date, button), and the number of rows would vary depending on the number of files in the folder.
If it’s possible, how can I do this?
Thank you for your help.
Best regards.
Daniel
For list of files,
http://download.oracle.com/javase/1.4.2/docs/api/java/io/File.html#listFiles()
I don’t know about how to get creation date, but there is a function for getting lastmodifieddate().
http://download.oracle.com/javase/1.4.2/docs/api/java/io/File.html#lastModified()
To open with the button, on button click event execute,
Runtime.getRuntime().exec(“cmd /c dir \””+
<filename from first column>+ “\””); (IF your OS is windows)To put all these in table,
http://www.java2s.com/Code/Java/Swing-Components/ButtonTableExample.htm