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

23
LINES

< > BotCompany Repo | #1031798 // ShowComboBoxForm

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (10075L/61K).

sclass ShowComboBoxForm {
  S desc;
  S itemDesc;
  LS items;
  S defaultValue;
  IVF1<S> action;
  JComboBox cb;
  
  S selected() { ret selectedItem(cb); }
  
  void run aka show() {
    cb = jComboBox(items, defaultValue);
    showFormTitled(desc, 
      "", jlabel(desc),
      itemDesc, cb,
      rThread {
        S item = selected();
        printVars(+item, +action);
        if (nempty(item))
          action.get(item);
      });
  }
}

Author comment

Began life as a copy of #1015667

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1031798
Snippet name: ShowComboBoxForm
Eternal ID of this version: #1031798/6
Text MD5: b47a0073a1295531c33164d8b2273ea4
Transpilation MD5: 119f0e0edbc3eeb0d9888b9628ac979a
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-07-01 17:44:21
Source code size: 467 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 248 / 397
Version history: 5 change(s)
Referenced in: #1034167 - Standard Classes + Interfaces (LIVE, continuation of #1003674)