Note that there are some explanatory texts on larger screens.

plurals
  1. PONetbeans ImageIcon not displaying
    text
    copied!<p>I am using the NetBeans GUIBuilder to make a JPanel Form. I added a JLabel and used NetBeans' interface to give it an icon from an external image (.png). The path is verified and the image shows up on the GUIBuilder screen. It even shows up when I click the "Preview Design" button. It DOES NOT show up when I RUN the project. The rest of the GUI appears as it should. Do any of you know why this happening and/or how to fix it?</p> <p>A lot of you have been asking for an SSCCE. Since the code is generated by the NetBeans Form Builder, I have instead included the steps I took to make the JLabel. The areas of focus are circled in red.</p> <ol> <li><p>Drag and drop a JLabel into the Form Builder. <img src="https://i.stack.imgur.com/71xH4.jpg" alt="Drag and drop a JLabel into the Form Builder."></p></li> <li><p>Open up the JLabel's properties menu. Enter the empty string ("") for the <code>text</code> field. Click the ellipsis next to <code>icon</code>. <img src="https://i.stack.imgur.com/Qa8PJ.jpg" alt="Open up the JLabel&#39;s properties menu. Click the ellipsis next to icon."></p></li> <li><p>Select External Image and click the ellipsis. <img src="https://i.stack.imgur.com/2WA54.jpg" alt="Select External Image and click the ellipsis."></p></li> <li><p>Select the image of choice. In my case it's a .png. <img src="https://i.stack.imgur.com/GOfHx.jpg" alt="Select the image of choice."></p></li> <li><p>Notice that the image appears in the icon preview. <img src="https://i.stack.imgur.com/2wKka.jpg" alt="Notice that the image appears in the icon preview."></p></li> <li><p>Close the icon menu and the properties menu, and notice that the image appears as the JLabel's icon on the Form Builder. <img src="https://i.stack.imgur.com/hRTj3.jpg" alt="Close the icon menu and the properties menu, and notice that the image appears on the Form Builder."></p></li> </ol> <p>Thank you for accepting an unorthodox SSCCE and thank you in advance for your help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload