please include function flatInfoBox. static int showWindowInTopRightCorner_x = 50; static int showWindowInTopRightCorner_y = 5; static JWindow showWindowInTopRightCorner(JComponent c) { ret showWindowInTopRightCorner(c, flatInfoBox_defaultTime); } static JWindow showWindowInTopRightCorner(final JComponent c, final double seconds) { if (isHeadless()) null; ret swing(func -> JWindow { final JWindow window = showWindow(c); window.pack(); window.setBounds(screenWidth()-window.getWidth()-showWindowInTopRightCorner_x, showWindowInTopRightCorner_y, window.getWidth(), window.getHeight()); window.setAlwaysOnTop(true); window.setVisible(true); disposeWindowAfter(iround(seconds*1000), window); ret window; }); }