Would it be possible for icons in the executable application via code?
Would it be possible for icons in the executable application via code?
Yes, it is possible:
URL iconURL = getClass().getResource("/some/package/favicon.png") ;
ImageIcon icon = new ImageIcon(iconURL);
frame.setIconImage(icon.getImage());
Or by creating a type Imagem
through the class ImageIO
, added in java-7:
Image imagem = ImageIO.read(getClass().getResource("/some/package/favicon.png"));
frame.setIconImage(imagem);
Source: How to set Icon to JFrame