I am building an application in Java where I need to represent a predefined directory in any kind of view in my window. Imagine something like a backup application where the main window displays all of the files under a specific directory.
Is there a way to do so using JavaFX? I do not care if files are going to be displayed as a tree or icons or anything really.
Thanks
edit: what I tried so far with no luck. This is my Controller class:
import javafx.scene.control.*;
import java.io.IOException;
public class ViewController {
public ListView listView;
public ViewController() throws IOException {
listView = new ListView();
listView.getItems().addAll("Iron Man", "Titanic", "Contact", "Surrogates");
}
}
and my fxml contains:
<ListView fx:id="listView" prefHeight="200.0" prefWidth="200.0" />