Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8497551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:09:26+00:00 2026-06-11T00:09:26+00:00

I want to set a image background on my JFrame thanks to automated generated

  • 0

I want to set a image background on my JFrame thanks to automated generated code by Netbeans.

Unfortunately, I am facing this exact problem :
http://www.areaofthoughts.com/2011/08/netbeans-jframe-properties-iconimage.html

When I tried to add it graphically, on details of iconImage, I have this error : “Custom editing of this property is not supported”

I tried the solution given in the link above, but unfortunately, this code doesn’t work:

public ArrayList<Image> getIconImages() {
   ArrayList<Image> imageList = new ArrayList();
   imageList.add(getClass().getResource("/<resource_path>" +
     "/image.png")).getImage());
   return imageList;  
}

What is the problem in this code, and how can I fix this problem of background (by any way?).

Please note that when I did it for label with Netbeans, I had no problem for doing it. The generated code was, for example, the following:

jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/main/myimage/img.png")));    
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:09:28+00:00Added an answer on June 11, 2026 at 12:09 am

    You generally have two choices.

    1- Create a custom JPanel that can paint the image as part of its background, then add this to your frame (once compiled, it can be dragged into the designer), have a look at Performing Custom Painting

    2- Set the layout of the JFrame to BorderLayout, add a JLabel to the frame. Assign a image/icon to the label. Set the layout of the label to what ever you need and your components toit.

    You may need to adjust the horizontal & vertical position of the icon within the label to suit your needs

    For an example, check out this previous answer Place JLabel on top of JLabel with image in

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to set page background image my css code is- background:url(images/body_bg.jpg) repeat-x top;
I want to set this style for an SVG <path> : background-color: red; background-image:
I want to set an image as the background for my uitableview . This
I want to set a background image for my form/window like this guy but
I want to set a image in background of App? How to set this?
I want to set background image to right and top of my span because
I want to set a background image to different divs, but my problems are:
I want to set an image as my background at runtime, so I created
I want to place links over a background image (set in CSS) and I
i want have an image and i want to set it as a background

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.