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

23
LINES

< > BotCompany Repo | #1020020 // showInternalFramePopupMenu

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

Libraryless. Click here for Pure Java version (1940L/13K).

1  
please include function componentPopupMenu.
2  
3  
static JPopupMenu showInternalFramePopupMenu(final JInternalFrame f) {
4  
  ret f == null ? null : swing(func -> JPopupMenu {
5  
    componentPopupMenu_init();
6  
    L maker = cast _get(findComponentPopupMenuListener_gen(f), 'maker);
7  
    if (empty(maker)) null;
8  
9  
    new JPopupMenu menu;
10  
    int emptyCount = menu.getComponentCount();
11  
    componentPopupMenu_mouseEvent.set(new MouseEvent
12  
      (f, MouseEvent.MOUSE_PRESSED, now(), 0, 30, 15, 1, true));
13  
    
14  
    for (O menuMaker : maker)
15  
      pcallF(menuMaker, menu);
16  
      
17  
    // show menu if any items in it
18  
    if (menu.getComponentCount() == emptyCount) null;
19  
    
20  
    menu.show(f, 30, 15); // ?
21  
    ret menu;
22  
  });
23  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1020020
Snippet name: showInternalFramePopupMenu
Eternal ID of this version: #1020020/12
Text MD5: bde31ca4d3b098981f4ff084c30906bc
Transpilation MD5: 1ec0cee89bb97fc9152bc1e80d2bf793
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-27 13:31:46
Source code size: 732 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 209 / 307
Version history: 11 change(s)
Referenced in: [show references]