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

  • Home
  • SEARCH
  • 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 9007653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:44:53+00:00 2026-06-16T01:44:53+00:00

I have developed an desktop application. The problem is when I export the application

  • 0

I have developed an desktop application. The problem is when I export the application to jar file the icon isn’t shown in the app. When I run it from Eclipse all icons are shown there.

An example from my project:

package net.ebank.gui;

import java.awt.*;
import javax.swing.*;


public class EBank extends JFrame {

    protected Start s;


    public EBank() {

        setTitle("Welcome To EBank");

        setBackground(Color.white);


        Image img = new ImageIcon("../EBank/res/bank.jpg").getImage();
        this.setIconImage(img);

        /*"com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"
        "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"*/

        setVisible(false);

        setSize(1350,700);

        setDefaultCloseOperation(this.EXIT_ON_CLOSE);

        try {

            UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        } catch (ClassNotFoundException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();
        } catch (InstantiationException e) {

            // TODO Auto-generated catch block

            e.printStackTrace();
        } catch (IllegalAccessException e) {
            // TODO Auto-generated catch block

            e.printStackTrace();
        } catch (UnsupportedLookAndFeelException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }


        s= new Start(this);

        s.setLocation(getWidth()/2, getHeight()/4);


    }

    public static void main(String[] args){
        new EBank();
    }

}
  • 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-16T01:44:54+00:00Added an answer on June 16, 2026 at 1:44 am

    In order to make it work, follow these steps :

    • Right-Click your Project in Project Explorer Tree.
    • Go to New -> Source Folder and then provide any Name to the Source
      Folder.
    • Now manually add your stuff to this Source Folder so created by you,
      like if you want to add images then make a New Folder, by manually
      visiting this Source Folder through File System.
    • Name this New Folder as images and copy your images to this Folder.
    • Now go back to your Eclipse IDE and Refresh your Project from the
      Project Explorer, by Right Clicking your Project, here you be able to
      see your added content now after refreshing.
    • Now in order to access, say any image, you will use.

      getClass().getResource("/images/yourImageName.extension");
      

    which will return one URL object. Do remember the first forward slash, in this case, since whatever is inside your Source Folder is accessed with the help of this, in simpler terms. Now when you will Run your project, the content of this Source Folder will be automatically added to the bin folder and when you will create a Runnable Jar, then the stuff inside your Source Folder can be accessed as it is.

    On this link, I had tried to explain that with images, how to add Images to your Eclipse Project

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

Sidebar

Related Questions

I have developed a desktop application. Now in that app I want to add
I have developed a desktop application for generating a file. Now I want to
I have developed a C# 4.0 desktop application that uses a SQL Server Express
We have a desktop client application developed in Swing. This application interacts with backend
I come from the iPhone development world but have never developed desktop applications. Now
I have developed sample api as jar file. This jar file contains the code
I have developed a Java server using Eclipse that accepts TCP socket connection from
We have an application which has been developed in PowerBuilder 9. The problem is
We have developed an application for 8830 Device and its working fine. The problem
I have developed an asp.net application and windows desktop application system. My clients can

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.