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

16
LINES

< > BotCompany Repo | #1020523 // makePopupMenuFullyDynamic

JavaX fragment (include)

svoid makePopupMenuFullyDynamic(JMenu menu, final VF1<JPopupMenu> populate) {
  addMenuListener(menu, new PopupMenuListener {
    public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
      clearPopupMenu(menu);
      callF(populate, menu);
    }
    
    public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
      clearPopupMenu(menu);
    }
    
    public void popupMenuCanceled(PopupMenuEvent e) {
      clearPopupMenu(menu);
    }
  });
}

Author comment

Began life as a copy of #1020521

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: #1020523
Snippet name: makePopupMenuFullyDynamic
Eternal ID of this version: #1020523/1
Text MD5: c0bc9c6c5d399122b0b1fefaca3ac9e9
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:10:09
Source code size: 471 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 302 / 307
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)