Custom JButton Icon in netbeans
Wondering how hard/how one would go about changing the default Icon using netbeans GUI builder, Just wondering if it is possible to load an image to be the icon of 开发者_JAVA百科button, rather then just the default silver/blue. Any help would be great! thank you.
When you're in the GUI builder select the JButton and you will be presented with its Properties in the palette (default location) click on the icon (...) button and you will be presented with the following screen that allows you to choose an Icon for the button.
Create new Package image.
Find folder [image(package)] in [src] folder of [Project Folder], and copy images to it.
In the Properties window of button, click the Properties category and scroll to the Icon property.
Select Package: jframe.image and File: in list.
Reference:
Insert icon image on JButton in NetBeans.
精彩评论