!7 class Msg { S author, text; } concept ItemPage { S globalID = aGlobalID(); S title, imageID; long created = now(), occurred; L comments = listInConcept(this); } static JTextPane textPane; p-subst { setConsoleInputFontSize(20); centerConsoleInput(); centerBottomConsole(); db(); bot("Show Item Page."); focusConsole(); } static bool showItemPage(S _word) { final new ItemPage p; fS word = trim(_word); cset(p, title := word); showPage(p); true; } svoid showPage(final ItemPage p) { swing { fS shorter = deUserSaid(p.title); JFrame f = getFrame(textPane); fS text = p.title + "\n\n"; frameToFront(showFrame(shorter, textPane = jcenteredtextpane(text, style_bold(style_fontSize(24))), f)); textPane.setEditable(false); focusConsole(); if (p.imageID == null) thread { BufferedImage img = quickVisualize(shorter); cset(p, imageID := "quickvis/" + urlencode(quickVisualize_preprocess(shorter)) + "/" + md5OfBufferedImage(img)); showPage(p); } else { BufferedImage img = quickVisualize(shorter); addImageToTextPane(textPane, img); } for (Msg c : p.comments) appendToTextPane(textPane, "\n\n" + c.author + ": " + c.text); } true; } answer { if (showItemPage(s)) ret "OK"; }