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)

static JButton renameButton(JComponent c, S name) {
  JButton b = first(childrenOfType(c, JButton.class));
  if (b != null)
    b.setText(name);
  ret b;
}

static JButton renameButton(JComponent c, S oldName, S newName) {
  JButton b = findButton(c, oldName);
  if (b != null) b.setText(newName);
  ret b;
}

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: 468 / 514
Version history: 2 change(s)
Referenced in: [show references]