How to change the java logo of a Jframe in netbeans?

1

I want to change the java logo which appears in the upper left part of the JFrame window. I use the following code in the Main constructor:

Image ico=Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("img/holger2.jpg"));

This.setIconImage(ico);
    
asked by Holger Edud 12.12.2018 в 22:51
source

1 answer

1

Try this:

//crea un ImageIcon y define la ruta de tu imagen
ImageIcon img = new ImageIcon("turuta");
//define el icon a tu JFrame
tuFrame.setIconImage(img.getImage());

I hope and serve you, greetings.

    
answered by 12.12.2018 в 22:55