How do I change the icon in the titlebar of a popup window?
Using the visionWindowOpened event handler...
For a main desktop, I do it this way:
from javax.swing import SwingUtilities, JFrame
from com.inductiveautomation.ignition.client.images import ImageLoader
icon = ImageLoader.getInstance().loadImage("Path/To/someImage.png")
jframe = SwingUtilities.getAncestorOfClass(JFrame, event.source)
jframe.setIconImage(icon)
For a popup window, I do it like this:
from com.inductiveautomation.ignition.client.images import ImageLoader
from javax.swing import ImageIcon
icon = ImageIcon(ImageLoader.getInstance().loadImage("Path/To/someImage.png"))
event.source.titleBar.getComponent(0).setIcon(icon)
2 Likes