What I am trying to accomplish is to take a pre-defined file path and display every folder and file within that file path inside of a JTree.
Simply;
Folder1
Folder2
Folder3a
->File3a
->File2a
->File2b
What I have so far is the following:
public class GUI extends JPanel {
public GUI() {
super(new GridLayout(1, 2, 20, 0));
setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (final Exception ignored) {
}
final JFrame frame = new JFrame();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setContentPane(this);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
I would love some direction on how to proceed. Everything this far has been a compilation of a ton of readings I have gone through, and I'm not really sure how to accomplish what I want.