I've written a simple script that reads the contents of a locally stored folder and then lists the results using a JFileChooser.
This works perfectly fine from within the Eclipse compiler but when I export the project to a Jar file, it can no longer see the directory.
Folder structure: (the scripts are located in com.maths.game)
The script:
displayList = new JList<Object>(new File("res/Questions/").listFiles());
displayList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
displayList.setLayoutOrientation(javax.swing.JList.HORIZONTAL_WRAP);
displayList.setName("displayList");
displayList.setCellRenderer(new MyCellRenderer());
displayList.setSize((getWidth() / 2) + (getWidth() / 3) + (getWidth() / 30),(getHeight() / 3));
displayList.setBorder(BorderFactory.createMatteBorder(2,2,2,2,Color.black));
displayList.setLocation((getWidth() / 15), (getHeight() / 3) + (getHeight() / 60));
And this is what is looks like from the Eclipse compiler.
The problem, from what I can tell, is the script can no longer see the 'Questions' folder and as a result, the script hangs. I'm struggling massively to see what the problem is. Any help would be greatly appreciated and if you need anymore information, I'll be happy to offer it up.