Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

20
LINES

< > BotCompany Repo | #1019977 // inputMultiLineText - show input form for multi-line text. calls action in new thread

JavaX fragment (include)

1  
static void inputMultiLineText(fS msg, fO action) {
2  
  inputMultiLineText(msg, "", action);
3  
}
4  
5  
// action: voidfunc(S)
6  
static void inputMultiLineText(fS msg, final S defaultText, fO action) {
7  
  fO threadInfo = _threadInfo();
8  
  awt {
9  
    final JTextArea ta = wordWrapTypeWriterTextArea(defaultText);
10  
    S title = joinStrings(" | ", msg, programName());
11  
    JComponent form = showFormTitled2(title,
12  
      unnull(msg), ta,
13  
      r {
14  
        vmBus_send('inputtingText_OK, threadInfo, msg, ta);
15  
        callF_thread(action, getText(ta))
16  
      });
17  
    renameSubmitButton(form, "OK");
18  
    vmBus_send('inputtingText, threadInfo, msg, ta);
19  
  }
20  
}

Author comment

Began life as a copy of #1014599

download  show line numbers  debug dex  old transpilations   

Travelled to 9 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1019977
Snippet name: inputMultiLineText - show input form for multi-line text. calls action in new thread
Eternal ID of this version: #1019977/3
Text MD5: f7f862757a0d89e8fe98ec14c42ff9f6
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-02 21:22:00
Source code size: 654 bytes / 20 lines
Pitched / IR pitched: No / No
Views / Downloads: 253 / 291
Version history: 2 change(s)
Referenced in: [show references]