I developed a desktop application. The problem is that when exporting the application to a jar file, the icon does not appear in the application. When I launch it from Eclipse, all the icons are displayed 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); setVisible(false); setSize(1350,700); setDefaultCloseOperation(this.EXIT_ON_CLOSE); try { UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); } catch (ClassNotFoundException e) {
java jar swing embedded-resource
Ali taha
source share