static JLabel showSuggestion_current; sbool showSuggestion_keyListenerInstalled; // action is called in new thread static JLabel showSuggestion(fS suggestionText, fO action) { hideSuggestion(); final int fontSize = 20, buttonFontSize = 15; final JLabel label = fontSize(fontSize, jCenteredMultiLineLabel(suggestionText)); final VF1 framePost = getThreadLocal(makeFrame_post); swing { makeFrame_post.set(or(framePost, vf1_frameAutoRequestFocusFalse())); JFrame f = alwaysOnTop(showPackedFrameInBottomRightCorner( withLineBorder(Color.black, withMargin( centerAndSouth( label, withTopMargin(makeFirstButtonBold(fontSizeAll(buttonFontSize, jcenteredbuttons( "OK" + appendBracketed(hotKey_teach()), r { hideSuggestion(label); callFInNewThread(action); }, "No", r { hideSuggestion(label) }))))))))); disposeWindowAfter_unlessMouseInIt(f, 3.0); showSuggestion_current = label; showSuggestion_installHotkey(); } ret label; } svoid showSuggestion_installHotkey { if (showSuggestion_keyListenerInstalled) ret; showSuggestion_keyListenerInstalled = true; onGlobalHotKey(hotKey_teach(), r-awt { if (isComponentShowing(showSuggestion_current)) clickFirstButton(getWindow(showSuggestion_current)); }); }