I\'m using NetBeans, trying to change the familiar Java coffee cup icon to a png file that I have saved in a resources directory in the jar file. I\'ve found many different
You can simply go Netbeans, in the design view, go to JFrame
property, choose icon image property, Choose Set Form's iconImage
property using: "Custom code" and then in the Form.SetIconImage()
function put the following code:
Toolkit.getDefaultToolkit().getImage(name_of_your_JFrame.class.getResource("image.png"))
Do not forget to import:
import java.awt.Toolkit;
in the source code!