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

16
LINES

< > BotCompany Repo | #1020521 // makeMenuFullyDynamic

JavaX fragment (include)

1  
svoid makeMenuFullyDynamic(final JMenu menu, final VF1<JMenu> populate) {
2  
  addMenuListener(menu, new MenuListener {
3  
    public void menuSelected(MenuEvent e) {
4  
      clearMenu(menu);
5  
      callF(populate, menu);
6  
    }
7  
    
8  
    public void menuDeselected(MenuEvent e) {
9  
      clearMenu(menu);
10  
    }
11  
    
12  
    public void menuCanceled(MenuEvent e) {
13  
      clearMenu(menu);
14  
    }
15  
  });
16  
}

Author comment

Began life as a copy of #1019361

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020521
Snippet name: makeMenuFullyDynamic
Eternal ID of this version: #1020521/2
Text MD5: 920b859074f30cb9920204331d765752
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-25 19:18:49
Source code size: 399 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 278 / 320
Version history: 1 change(s)
Referenced in: [show references]