for a simple Java Desktop Application I added a JFrame Form with the assistant of the NetBeans IDE. For this frame I want to change the icon in the title bar.
I tried to do so with the following code at the very end of the constructor in the generated View class:
ImageIcon ii = new ImageIcon(iconUrl);
this.getFrame().setIconImage(ii.getImage());
The String iconUrl is definitely correct, the object ii seems to be alright as far as I can judge from the variables overview in the debugger perspective.
However, the icon in the title bar does not change, it’s still the default java icon.
Why?
You can try this:
Note that here
/would represent yoursrcdirectory