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 4598948
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:28:17+00:00 2026-05-21T23:28:17+00:00

I have added Images folder inside src folder in Java project. For setting top

  • 0

I have added “Images” folder inside “src” folder in Java project.

For setting top left image on title bar I am using image from Image folder.
To do that I have written code
Image img=Toolkit.getDefaultToolkit().getImage("src/Images/Sell Smart2 copy.jpg");
frame.setIconImage(img);

This works fine when project run through Netbeans
But when I run jar of that project through command line using command “java -jar project.jar” then Image is not shown.

Why this problem coming ? Any solution for that

Thanks,
Image added for refernce.

enter image description here

  • 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-05-21T23:28:18+00:00Added an answer on May 21, 2026 at 11:28 pm

    Just drop the src from your path.
    Also, while loading jarred images, you should be using getClass().getResource()

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

Sidebar

Related Questions

I have created a new folder in my project, aptly named 'images'. I have
I have a windows service using a FileSystemWatcher to monitor a folder, print added
I have a new django project called mysite. Inside mysite is a folder called
I have an image in my project. In Solution Explorer, I've created a folder
How do I access an image during run time that I have added to
I have a gridview that I have added a checkbox column using a templatefield
I have searched for a method of embedding a resource in a java project
I have a WPF application where I added the images as resources to the
I accidentally added a folder of images and committed. Then, I made one more
I have an image stored on server at location: C:\inetpub\wwwroot\imageupload\images in my code i

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.