JLabel setIcon causes runtime error?

This declaration presumes the image is on the run-time class-path of the application, and accesses it by URL. This is the way to access a resource in a Jar.

This declaration presumes the image is on the run-time class-path of the application, and accesses it by URL. This is the way to access a resource in a Jar. HelpLabel.

SetIcon(new javax.swing. ImageIcon(getClass(). GetResource("/bepe/resources/orIntro.

Png"))); This declaration presumes the String argument represents a File path. It will not work for an 'application resource' that is (presumably) in a Jar. HelpLabel.

SetIcon(new ImageIcon("/bepe/resources/" + e. ImageFile)); Use getResource consistently, and make sure the image is on the run-time class-path.

OK, I tried using getResource again, and for some reason the runtime error I was getting before disappeared and the image showed up. Don't know what happened before, but now it works, so thanks. – Bea Metitiri Nov 28 at 3:09.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions