static bool showAnimationInTopRightCorner_alwaysOnTop = true; static bool showAnimationInTopRightCorner_on = true; // automatically switches to AWT thread for you // text is optional text below image static JWindow showAnimationInTopRightCorner(S imageID, S text) { if (isHeadless() || !showAnimationInTopRightCorner_on) null; ret showAnimationInTopRightCorner(imageIcon(imageID), text); } static JWindow showAnimationInTopRightCorner(final Image image, final S text) { if (image == null || isHeadless() || !showAnimationInTopRightCorner_on) null; ret showAnimationInTopRightCorner(imageIcon(image), text); } static JWindow showAnimationInTopRightCorner(final ImageIcon imageIcon, final S text) { if (isHeadless() || !showAnimationInTopRightCorner_on) null; ret (JWindow) swingAndWait(func { JLabel label = new JLabel(imageIcon); if (nempty(text)) { label.setText(text); label.setVerticalTextPosition(SwingConstants.BOTTOM); label.setHorizontalTextPosition(SwingConstants.CENTER); } final JWindow window = showInTopRightCorner(label); onClick(label, r { window.dispose() }); if (showAnimationInTopRightCorner_alwaysOnTop) window.setAlwaysOnTop(true); ret window; }); } static JWindow showAnimationInTopRightCorner(final S imageID) { ret showAnimationInTopRightCorner(imageID, ""); } static JWindow showAnimationInTopRightCorner(S imageID, double seconds) { ret showAnimationInTopRightCorner(imageID, "", seconds); } static JWindow showAnimationInTopRightCorner(S imageID, S text, double seconds) { if (isHeadless()) null; ret disposeWindowAfter(iround(seconds*1000), showAnimationInTopRightCorner(imageID, text)); } static JWindow showAnimationInTopRightCorner(BufferedImage img, S text, double seconds) { ret disposeWindowAfter(iround(seconds*1000), showAnimationInTopRightCorner(img, text)); }