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

7
LINES

< > BotCompany Repo | #1004936 // tableDependButtons

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

Libraryless. Click here for Pure Java version (10770L/60K).

static void tableDependButtons(JTable table, L<? extends Component> buttons) {
  for (Component c : buttons)
    if (c instanceof JButton) {
      JButton b = cast c;
      onTableSelectionChangedAndNow(table, -> b.setEnabled(table.getSelectedRow() >= 0));
    }
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004936
Snippet name: tableDependButtons
Eternal ID of this version: #1004936/6
Text MD5: a43b691a8ba808eb7adc4010df872189
Transpilation MD5: dd88fc299187aedd20ea4db54cd7160d
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-04-05 17:13:16
Source code size: 270 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 626 / 687
Version history: 5 change(s)
Referenced in: #1005049 - textComponentDependButtons
#1005360 - listDependButtons - enable buttons when an item is selected in a JList
#1006566 - tableDependButton
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1021480 - treeDependButton