I am trying to read a file from my executable .jar file but it keeps getting null values.
I have this code:
public DanceEventTicketScanner(String txtfile){
sv = new ScannerView(this);
findcode = false;
InputStream is = this.getClass().getResourceAsStream("/resources/copy.csv");
if (is == null) JOptionPane.showMessageDialog(null, "Resource not located.");
}
In the JAR file i have (as normal) a folder containing all my .class files and in the same directory a folder named resources which holds the copy.csv file.
This code however does not recognize the file.
Does anyone have any ideas?