Adding images in the Netbeans IDE
Simplified Instructions:
Inside a JFrame,
Create a JLabel,
Select the JLabel,
In the properties Pane find the icon property, and click the (...) next to it.
In the dialog box that appears, click import to project and navigate to the picture.
Extra Credit:
It is good programming practice to create a separate package for your picture / media resources in the holy name of good organizational practices. You can do this by right clicking your project package that you created originally (You can find it by looking at the icon, it will be of an icon in 4 quadrants with a 3d look.)
and right clicking on it, and clicking New => Java Package.
Specific Instructions:
Step 1: You must create the application form. Do this by clicking, File -> New Project -> Finish.
Step 2: In the Projects field, (the top left, by default) expand the Project's tree by clicking on the + sign next to it. Then right click on the Source packages node and click New => JFrame Form => Finish.
Step 3: In the JFrame, create a JLabel using the Palette, (Top right by default) by clicking and dragging Label to the JFrame area.
Step 4: Click the JLabel that you created, and then find the properties panel, typically it's a window in the bottom right of your Netbeans IDE. Then navigate to the icon property, and click the (...) button next to it.
Step 5: Click Import to project and navigate to the picture of your choice. You're done! =D
DETAILED VIDEO BELOW
Nice. Your Kidding me Right ??
ReplyDelete:P
My name is Mich by the way :D HAHAHA
Deleteyes and that is diferent from puting a jlabel in your control to start with - your method you just jave the same effect nested in another class
ReplyDeletei want to change image on clicking button i.e., i want methods used
ReplyDeletehttps://netbeans.org/kb/docs/java/gui-image-display.html#custom
DeleteIt's really nice & very easy way.
ReplyDeleteTHANKS A LOT!