javaapacheswingnetbeansjlabel

Icon property for JLabel doesn't show up in the properties palette of Netbeans Apache 11


So I have this issue where I can't see the icon property for JLabel in the Netbeans apache IDE. It showed up just fine on NetBeans 8.2.

What it should look like :

https://i.sstatic.net/Qa8PJ.jpg

What it looks like for me :

https://uploads.disquscdn.com/images/16fa550b1d47e029d3c10b040b099f3c638f901da222464c04f917bc72282f53.png

I can't see any 'icon' property to set an image for the JLabel.

And yeah I could have posted images using the tags but it says I need atleast 10 rep so I just pasted the links, sorry about that.

Any help appreciated.


Solution

  • Netbeans Apache IDE icon property not available directly

    https://netbeans.org/kb/docs/java/gui-image-display.html

    Refer this above link,

    To add the image to the label:

    1. In the GUI Designer, select the label that you have added to your form.
    2. In the Properties window, click the Properties category and scroll to the Icon property.
    3. Click the ellipsis (...) button.The icon property editor is displayed.

    enter image description here

    1. In the icon property dialog box, click Import to Project.
    2. In the file chooser navigate to any image that is on your system that you want to use. Then click Next.
    3. In the Select target folder page of the wizard, select the newpackage folder and click Finish.

    enter image description here

    1. Click OK to close the icon property dialog box. After you click OK, the IDE does the following things:

      • Copies the image to your project. Therefore, when you build and distribute the - ------- application, the image is included in the distributable JAR file.
      • Generates code in the ImageDisplay class to access the image.
      • Displays your image on the label in the Design view of your form.