Hi everyone,

I have a simple project in java / maven  in apache netbeans.

I have a JFrame with a label that I have been trying to add an image to.

I continually get this error when the program tries to add the image to the
label:

*Cannot invoke "java.net.URL.toExternalForm()" because "location" is null*


I have tried using the image selector, as well as custom code options. I
have tried all the advice from stack overflow --- and I simply can't figure
it out. I must have spent 3-4 hours --- and I'm about to give up.

Can anyone tell me why its so difficult to add an image to a JFrame?  Is
there a simple way to do it? Am I missing something?

PS: This link seems to be a great resource for my problems... but I'm still
getting the error!
https://netbeans.apache.org/kb/docs/java/gui-image-display.html


-- 

Dwayne Murphy
"Carpe Diem"
Hons B.Computer Science, B. Ed, Hons B.Commerce
Holy Names High School - Science, Business & Civics

Holy Names: 519-966-2504
Cell Number: 519-995-6915

Reply via email to