Working in Java Swing I would like to be able to dynamically change the icon
of the JFrame
as events happen in the code without having any .pngs. Is there any way to draw the image internally and have it then used as the icon, so that I can do something like the below?
public void Icon(Graphics g){
ImageIcon img = g.getImageIcon();
myFrame.setIconImage(img.getImage());
}