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

17
LINES

< > BotCompany Repo | #1007006 // jradiobutton - make a JRadioButton & add to ButtonGroup

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

Libraryless. Click here for Pure Java version (2937L/17K).

1  
static JRadioButton jradiobutton(S text, ButtonGroup group) {
2  
  ret swing(func -> JRadioButton {
3  
    JRadioButton rb = new JRadioButton(text);
4  
    if (group != null) group.add(rb);
5  
    ret rb;
6  
  });
7  
}
8  
9  
static JRadioButton jradiobutton(ButtonGroup group, S text) {
10  
  ret jradiobutton(text, group);
11  
}
12  
13  
static JRadioButton jradiobutton(ButtonGroup group, S text, bool selected) {
14  
  var rb = jradiobutton(group, text);
15  
  if (selected) selectRadioButton(rb);
16  
  ret rb;
17  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007006
Snippet name: jradiobutton - make a JRadioButton & add to ButtonGroup
Eternal ID of this version: #1007006/5
Text MD5: 6b7be4c12e402a9dc1c4bed30996061d
Transpilation MD5: 1dce8ed1fe153f53722f7ff9c45963ae
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-11 15:20:22
Source code size: 481 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 546 / 608
Version history: 4 change(s)
Referenced in: [show references]