I’m using the messaging system to occasionally send clients a message to show the user. I was wondering if anyone had a way to make the window for this client flash in the taskbar, like some other applications do when they have some sort of notification or want to get your attention for whatever reason. When researching online for ways to do that in Swing, I see some suggestions for getting some library to do it (not worth it to go through that for me) and some saying use the Swing .toFront() or .requestFocus() on the top level window. I’ve done this (via SwingUtilities getAncestorWindow()) but unfortunately it isn’t working. Anyone know of a way to do this without adding any libraries?
from java.awt import Window from javax.swing import SwingUtilities allWindows = system.gui.getOpenedWindows() if len(allWindows)>0: topWindow = SwingUtilities.getAncestorOfClass(Window, allWindows) topWindow.toFront()