Closed gareth-edwards closed 1 week ago
BTW, you can keep using JFrame, CanvasFrame is just for convenience.
I love CanvasFrame! Used it to make a media player https://github.com/bytedeco/javacv/issues/2123
Just wish I knew how to get it to have an icon?
To get a custom icon when extending CanvasFrame, I have found that setIconImage has to be called before the setVisible in the CanvasFrame init method.
The easiest for me was:
public MyCanvasFrame(String title, double gamma) {
super(title);
setIconImage(Toolkit.getDefaultToolkit().getImage(MyCanvasFrame.class.getResource("logo.png")));
init(false, null, gamma);
}
Forgive me in case it's really simple but this code that extends the Swing JFrame shows the running app icon in the Ubuntu dock:
But this code that extends the Bytedeco CanvasFrame does not:
Am I missing something really simple? How does one put an icon image on the CanvasFrame
Thanks and all the best,