Error inserting icon in Jlabel

Asked

Viewed 252 times

1

I’m doing a graphical interface in a java project (Maven) and I’m having a problem trying to put an icon in Jlabel.

inserindo icon ao JLabel

And when I run the project gives the following error:

Erro

Since I am using the netebeans GUI, there is no way for me to edit the code that is generated by the IDE itself. I tested the same interface in a common java project (without Maven) and it worked normally, does anyone know why this is happening only in Maven projects? I did some research and found some other problems similar to Maven projects, adding icons on buttons etc.

  • As can be seen in the first print, the icon is not being set in the properties(Right). Check if you are not setting for a different Jlabel component or, in the worst case, remove the icon reference in Gui and do it manually, by code.

  • It was not set in the properties because I was still adding. After clicking on the "OK" button the icon name would be there in the properties.

  • Got it, add a [mcve] to the question, so you can analyze and reproduce the problem.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.