How do I remove the icon (the coffee cup) in a Java Jframe.
How do I remove the icon (the coffee cup) in a Java Jframe.
You must create a ImageIcon
:
ImageIcon img = new ImageIcon(pathDelIcon);
Then you set it on your JFrame with setIconImage()
:
objetoJFrame.setIconImage(img.getImage());
If your image is a resource:
objetoJFrame.setIconImage(
Toolkit.getDefaultToolkit().getImage(
getClass().getResource(pathDelIconResource)
)
);