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).

please include function componentPopupMenu.

static JPopupMenu showInternalFramePopupMenu(final JInternalFrame f) {
  ret f == null ? null : swing(func -> JPopupMenu {
    componentPopupMenu_init();
    L maker = cast _get(findComponentPopupMenuListener_gen(f), 'maker);
    if (empty(maker)) null;

    new JPopupMenu menu;
    int emptyCount = menu.getComponentCount();
    componentPopupMenu_mouseEvent.set(new MouseEvent
      (f, MouseEvent.MOUSE_PRESSED, now(), 0, 30, 15, 1, true));
    
    for (O menuMaker : maker)
      pcallF(menuMaker, menu);
      
    // show menu if any items in it
    if (menu.getComponentCount() == emptyCount) null;
    
    menu.show(f, 30, 15); // ?
    ret menu;
  });
}

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: 113 / 169
Version history: 11 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1020020 & http://1020020.tinybrain.de