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)

static JComponent mapMethodLike dm_textFieldAndSubmit(S field, fS submitMethodName, O... _) {
  final DynModule m = dm_current_mandatory();
  ret dm_textFieldAndSubmit(field, rThread { call(m, submitMethodName) }, _);
}

static JComponent dm_textFieldAndSubmit(S field, Runnable action, O... _) {
  JTextField tf = boolPar centered(_) ? dm_centeredTextField(field) : dm_textField(field);
  if (boolPar focusOnShow(_)) focusAndSelectAllOnShow(tf);
  ret centerAndEastWithMargin(onEnter(tf, action),
    jbutton(optPar buttonText(_, "Submit"), action));
}

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: 363 / 436
Version history: 13 change(s)
Referenced in: [show references]