5
I have an application in Java, this application has images, and I had the same problem: when generating the arch. jar(executable) the images did not appear, but if it ran straight into Netbeans, it would appear. I solved the problem by putting the image inside a folder I created (data) inside the scr folder, and in the code I did:
new ImageIcon(getClass().getResource("/dados/img.jpg"));
This solved the problem, now the business is with file . txt, how do I do it? I need to read a txt, in Netbeans it finds the right file, but the generated jar file is not found
EDIT
File arq = new File("src/dados/arq.txt");
Worked thanks
– Ablon