In NetBeans IDE 6.1, how can I get icons for my custom GUI components in the GUI editor?

Although this is by no means very important, I'm just curious about how to tell the community how to place icons for my custom GUI components that appear in NetBeans GUI Designer.

I made some Swing components. Then I use the menu options to add them to the GUI palette, but they are displayed with ?? icons. It would be nice if they got icons that look like swing components, such as JButton, especially for components that are subclassed from Swing components.

+3
source share
1 answer

You will need to create a BeanInfo file for your components. Find your component in the Projects window. Right-click on it and select "BeanInfo Editor". Make sure you want to create BeanInfo. Click on the "Designer" tab. Select the BeanInfo element at the top of the tree. The properties panel has properties for color and mono icons in 16x6 and 32x32. Set them in the path to png or gif files. They decide as resources, so they should be in your source tree. Usually I add the "resource" package inside the package that contains my component and puts the images there.

Then from Tools> Palette> Swing / AWT Components and add components from the project.

, , , , , .

+3

Source: https://habr.com/ru/post/1743745/


All Articles