Adding images on Java JFrame - Netbeans

℡╲_俬逩灬. 提交于 2019-12-01 13:58:11
  1. Open the form in NetBeans form editor.
  2. Add a JLabel from the pallete to the form
  3. Select the label you just added and click the "..." button next to the icon property
  4. Fill out the properties.

It's normally best that the images reside within the project folder, makes deployment easier in the long run.

  1. Copy Image to your Netbeans project.
  2. Add new label to the frame.
  3. Select the label and Right click->Go to Properties.
  4. In Icon property select image by down arrow as shown in image.

Make sure when you add the JLabel to use it from Swing Controls not AWT.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!