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

11
LINES

< > BotCompany Repo | #1021020 // dm_textFieldAndSubmit - TODO: selectAll doesn't seem to work

JavaX fragment (include)

1  
static JComponent mapMethodLike dm_textFieldAndSubmit(S field, fS submitMethodName, O... _) {
2  
  final DynModule m = dm_current_mandatory();
3  
  ret dm_textFieldAndSubmit(field, rThread { call(m, submitMethodName) }, _);
4  
}
5  
6  
static JComponent dm_textFieldAndSubmit(S field, Runnable action, O... _) {
7  
  JTextField tf = boolPar centered(_) ? dm_centeredTextField(field) : dm_textField(field);
8  
  if (boolPar focusOnShow(_)) focusAndSelectAllOnShow(tf);
9  
  ret centerAndEastWithMargin(onEnter(tf, action),
10  
    jbutton(optPar buttonText(_, "Submit"), action));
11  
}

Author comment

Began life as a copy of #1021018

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1021020
Snippet name: dm_textFieldAndSubmit - TODO: selectAll doesn't seem to work
Eternal ID of this version: #1021020/14
Text MD5: 440d6f1926299bfb8076bb15662ae8f4
Author: stefan
Category: javax / stefan's os
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-15 18:30:35
Source code size: 565 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 364 / 437
Version history: 13 change(s)
Referenced in: [show references]