!7 sS background = #1009946; static IVar text; static JTextField tf; static JDesktopPane desktop; static Q q = startQ(); p-nimbus { text = persistentVar("Text", "Show me a window!"); onEnter(tf = bindTextFieldToVar(text, jcenteredtextfield(text!)), f go); desktop = jTiledBackgroundDesktopPane(background); autoFixDesktopPane(desktop); addFullSizeComponent(desktop, jtransparent_recursive(jTopCenter(hstackWithSpacing(withTopMargin(60, hstackWithSpacing(jMinWidth(400, setFontSize(30, tf)), jbutton("OK", f go)/*, jbutton("Exit", f cleanKill)*/)))))); cleanExitOnFrameClose(showFrame/*MaximizedFrame*/(desktop)); focus(tf); } svoid go { callStaticAnswerMethod(getText(tf)); } answer { fS _s = s; q.add(r { answer_impl(_s) }); } svoid answer_impl(S s) { new Matches m; Web web = webFromTriples("User typed", "", quote(s)); postSoftwareMadeWeb(web); if "show me a window" swing { addInternalFrame(desktop, "Here it is.", random(100, desktop.getWidth()-100-300), 400, 300, 200); } L nodes = web_allOperands(indexedNodes("Things to do on user input")); for (WebNode node : nodes) { S fname = "action_" + camelCase(web_text(node)); if (isStandardFunction(fname)) { print("Can call: " + fname); infoBox("Calling " + fname); Class c = loadFunctions_cached('action_text, fname); call(c, 'action_text, s); call(c, fname); } else print("Can't call: " + web_text(node) + " / " + fname); } }