F
Fuma
Hello,
I know this question has been asked before, but I cannot seem to
get the solutions posted to work. I am trying load to three images and
a text file from a jar file (this jar file is not in the classpath).
This jar file is the main jar file though. I intend for users to be
able to download this file to their desktop, double click, and run.
Unfortunately, I cannot figure out how to load the three images and
textfile from the jar file.
I have tried this solution but it doesnt want to work:
URL url = this.getClass().getResource("Teacher_online.jpg");
image = new ImageIcon( url );
and it says it can not file the file. And for the text file i have
URL url = this.getClass().getResource("config_student.ini");
ins = new InputStreamReader(url.openStream());
bufferedReader = new BufferedReader( ins );
If somone could shed some light on this problem i am having, i would
really appreciate it!
Thanks,
Chris
I know this question has been asked before, but I cannot seem to
get the solutions posted to work. I am trying load to three images and
a text file from a jar file (this jar file is not in the classpath).
This jar file is the main jar file though. I intend for users to be
able to download this file to their desktop, double click, and run.
Unfortunately, I cannot figure out how to load the three images and
textfile from the jar file.
I have tried this solution but it doesnt want to work:
URL url = this.getClass().getResource("Teacher_online.jpg");
image = new ImageIcon( url );
and it says it can not file the file. And for the text file i have
URL url = this.getClass().getResource("config_student.ini");
ins = new InputStreamReader(url.openStream());
bufferedReader = new BufferedReader( ins );
If somone could shed some light on this problem i am having, i would
really appreciate it!
Thanks,
Chris