!752 static JTextArea textArea; static float fontSize = 24f; static S fontSnippet = //"#1000967" // a TrueType font (works, but no punctuation) //"#1000969" // an OpenType font (works! but hard to read) //"#1000970" //"#1004887" // the great Akashi "#1004889"; static Font loadFont() ctex { return Font.createFont(Font.TRUETYPE_FONT, loadLibrary(fontSnippet)).deriveFont(fontSize); } p { textArea = new JTextArea(); textArea.setFont(loadFont()); textArea.setMargin(new Insets(10, 10, 10, 10)); textArea.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER && e.getModifiers() == 0) { enterPressed(); } } }); makeFrame("Dialog", new JScrollPane(textArea)); sleep(); // important for auto-logging as of now } static void enterPressed() { S text = textArea.getText(); int idx = textArea.getCaretPosition(); // move to end of line first while (idx < text.length() && text.charAt(idx) != '\n') ++idx; textArea.setCaretPosition(idx); //print(quote(text.substring(0, idx))); int lineStart = text.lastIndexOf("\n", idx-1); //print(lineStart + " " + idx); S line = text.substring(lineStart+1, idx); print("?? " + line); processLine(line); } static void processLine(S line) { type(line + "??"); } static void type(S bla) { print("!! " + bla); textArea.insert("\n" + bla, textArea.getCaretPosition()); }