Is the res folder still in the build-path? if yes, try to remove it, paste it into your source-folder again and try it with the given advices.
Now, quick question, with the res folder in the build path, shouldn’t it automatically take everything from the res folder and drop it into the bin folder?
Yes. There’s no need to put everything inside the src folder. There’s a problem somewhere else. Lemme hack an example program for some “working” code.
Okay, i tried deleting all the images and .src files from the bin folder and when i went to run it, it didn’t automatically put them back.
You shouldn’t ever need to touch anything inside the bin folder yourself. Try refreshing the project. Here’s a test I made and it works fine for me:
http://www.java-gaming.org/user-generated-content/members/54159/testfile.jar
You can unzip the jar file to see what’s inside.
source code:
package com.heartpirates;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.swing.JFrame;
import javax.swing.JTextArea;
public class Main extends JTextArea {
String text = "";
public Main() {
this.setRows(6);
}
public void work() throws IOException {
InputStream is = Main.class.getClassLoader().getResourceAsStream(
"names.src");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
boolean running = true;
String s = null;
while (true) {
s = br.readLine();
if (s == null)
break;
print(s);
}
print("Done.");
}
private void print(String s) {
text += s + "\n";
this.setText(text);
System.out.println(s);
}
public static void main(String[] args) {
Main m = new Main();
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(m);
frame.pack();
frame.setVisible(true);
try {
m.work();
} catch (IOException e) {
e.printStackTrace();
}
}
}
OK, I’ve got it now. I’ve got it just how you set it up, jonjava. Also, I had no idea that the string for the name was case sensitive. You people have been a huge help. Thanks so much.