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

12
LINES

< > BotCompany Repo | #1006620 // renameButton - rename first button in a panel

JavaX fragment (include)

1  
static JButton renameButton(JComponent c, S name) {
2  
  JButton b = first(childrenOfType(c, JButton.class));
3  
  if (b != null)
4  
    b.setText(name);
5  
  ret b;
6  
}
7  
8  
static JButton renameButton(JComponent c, S oldName, S newName) {
9  
  JButton b = findButton(c, oldName);
10  
  if (b != null) b.setText(newName);
11  
  ret b;
12  
}

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: #1006620
Snippet name: renameButton - rename first button in a panel
Eternal ID of this version: #1006620/3
Text MD5: 599c6f0f05e2e9b6fcc4125cb521ed1c
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-12 23:38:26
Source code size: 319 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 472 / 520
Version history: 2 change(s)
Referenced in: [show references]