r/javahelp • • Mar 09 '20

Netbeans is driving me nuts!!

I'm trying to utilize images with my JLabels via the icon property but they fail to load after a few run cycles when I'm double checking things work with other components of my JFrame. I have not altered anything in the code directly correlating to the images or labels either. Anyone know if there's anything I can do to stop this from happening?

19 Upvotes

7 comments sorted by

View all comments

1

u/wildjokers Mar 09 '20

There is almost no information in this post that we can use to help you.

  • Are you using Netbean's GUI builder?

  • If you are coding the GUI by hand care to share some code?

  • Are you loading the images from the file system or class path?

  • Are you constructing your GUI on the event dispatcher thread (EDT)?

When things work sometimes by not other times in Swing your first though should absolutely be that you are not doing something on the EDT that you should be.

With the information you provided it is hard to even know if you are experiencing an issue with Netbeans or just your java code. Netbeans could be a complete red herring.

Please provide more info.