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

11
LINES

< > BotCompany Repo | #1003298 // swingChoose - offer choices in Swing window

JavaX fragment (include)

1  
// runnable must implement a "run(S)" method
2  
static JFrame swingChoose(L<S> options, fO runnable) {
3  
  final JFrame[] frame = new JFrame[1];
4  
  new L parts;
5  
  for (final S s : options)
6  
    parts.add(newButton(s, runnable {
7  
      frame[0].dispose();
8  
      callOpt(runnable, "run", s);
9  
    }));
10  
  ret frame[0] = showPackedFrame("Please choose", vgrid(parts));
11  
}

Author comment

Began life as a copy of #1003293

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1003298
Snippet name: swingChoose - offer choices in Swing window
Eternal ID of this version: #1003298/1
Text MD5: 6a39295d355af6edad0143d9bf28008b
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-06-17 19:12:25
Source code size: 367 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 543 / 523
Referenced in: [show references]