Java Tutorial: Working with Files and Directories in Java:
The idea is that the whole directory structure is transferred once to the browser, and then the directories are opened or closed by changing the “display” style-property of the directories. To make this work we need to add two things to the HTML-page:
Now we only need to make a new subclass of MyFileStructure. It’s called MyFileStructureJS, and it is almost identical to MyFileStructureExplorer. We only need to add the <span>-tags and the name of the folder-gif’s. Here is an outline of the class with the added code shown in bold:
If you try this solution I’m sure you’ll be impressed by the response times.