1 | static <A extends JButton> A treeDependButton(final JTree tree, final A b) { |
2 | if (b != null) swing { |
3 | tree.addTreeSelectionListener(new TreeSelectionListener { |
4 | public void valueChanged(TreeSelectionEvent e) { |
5 | b.setEnabled(getSelectedTreeNode(tree) != null); |
6 | } |
7 | }); |
8 | b.setEnabled(getSelectedTreeNode(tree) != null); |
9 | } |
10 | ret b; |
11 | } |
Began life as a copy of #1004936
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1021480 |
Snippet name: | treeDependButton |
Eternal ID of this version: | #1021480/4 |
Text MD5: | 05974b17deb7205b1a699b07fc344080 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-02-14 17:01:01 |
Source code size: | 369 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 327 / 344 |
Version history: | 3 change(s) |
Referenced in: | [show references] |