Adding images on Java JFrame - Netbeans

后端 未结 3 1063
-上瘾入骨i
-上瘾入骨i 2021-01-16 06:26

I\'m using NetBeans 7.1 to code in Java. I have already created a JFrame filled with some labels, textbox and buttons. How can I d

相关标签:
3条回答
  • 2021-01-16 06:30
    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.

    0 讨论(0)
  • 2021-01-16 06:45
    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.

    0 讨论(0)
  • 2021-01-16 06:45

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

    0 讨论(0)
提交回复
热议问题