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?


1 | import greenfoot.core.WorldHandler; |
1 2 3 | JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame. class , panel); ImageIcon img = new ImageIcon( this .getClass().getResource( /*path to image*/ )); f.setIconImage(img.getImage()); |
1 | import greenfoot.core.WorldHandler; |
1 2 3 | JFrame f = (JFrame) SwingUtilities.getAncestorOfClass(JFrame. class , panel); ImageIcon img = new ImageIcon( this .getClass().getResource( /*path to image*/ )); f.setIconImage(img.getImage()); |
1 2 3 4 5 6 7 | 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()); |