abstract sclass DynDialogWithUser > DynModule { L dialog = synchroList(); S input; transient JTextArea taDialog; transient JTextField tfInput; sclass DialogItem { S author, line; long timestamp = now(); toString { ret "[" + localTimeWithSeconds(timestamp) + "] " + author + ": " + line; } } visualize { tfInput = dm_fieldTextField('input); onEnter(tfInput, rThread sendInput); ret centerAndSouthWithMargins( jSection("Dialog", taDialog = setDisabledTextColor(Color.black, makeUneditable(jLiveValueWordWrapTypeWriterTextArea_autoScroll(mapLiveValue_f0(func -> S { dialogToString() }, S, dm_fieldLiveValue('dialog)))))), withLabel("Your input:", tfInput)); } void sendInput { addLine('User, input); selectAll(tfInput); } // API S dialogToString() { ret lines_rtrim(allToString(cloneList(dialog))); } void addLine(S author, S line) { dialog.add(nu(DialogItem.class, +author, +line)); } }