Hello,
When I export my game as a jar-file and open it. Then I have in the taskbar always such an ugly picture, how can I change the icon?
import greenfoot.core.WorldHandler;
JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, panel); ImageIcon img = new ImageIcon(this.getClass().getResource(/*path to image*/)); f.setIconImage(img.getImage());
import greenfoot.core.WorldHandler;
JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, panel); ImageIcon img = new ImageIcon(this.getClass().getResource(/*path to image*/)); f.setIconImage(img.getImage());
import greenfoot.core.WorldHandler;
import javax.swing.*;
JPanel panel = WorldHandler.getInstance().getWorldCanvas();
JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame.class, panel);
ImageIcon img = new ImageIcon(this.getClass().getResource(" I M A G E "));
f.setIconImage(img.getImage());