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

28
LINES

< > BotCompany Repo | #1005735 // addMenuItem - add JMenuItem to JMenu/JPopupMenu/Menu

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

Transpiled version (3411L) is out of date.

static void addMenuItem(JPopupMenu menu, S text, O action) {
  menu.add(jmenuItem(text, action));
}

static void addMenuItem(JPopupMenu menu, JMenuItem menuItem) {
  if (menu != null && menuItem != null)
    menu.add(menuItem);
}

static void addMenuItem(JMenu menu, S text, O action) {
  menu.add(jmenuItem(text, action));
}

static void addMenuItem(Menu menu, S text, O action) {
  menu.add(menuItem(text, action));
}

static void addMenuItem(JMenu menu, JMenuItem menuItem) {
  menu.add(menuItem);
}

svoid addMenuItem(JMenuBar menuBar, S text, Runnable action) {
  addMenuItem(menuBar, jmenuItem(text, action));
}

svoid addMenuItem(JMenuBar menuBar, JMenuItem menuItem) {
  addDirectMenuItem(menuBar, menuItem);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005735
Snippet name: addMenuItem - add JMenuItem to JMenu/JPopupMenu/Menu
Eternal ID of this version: #1005735/14
Text MD5: a3aa142535d32720fb5e1f55d4601db8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-24 22:50:55
Source code size: 745 bytes / 28 lines
Pitched / IR pitched: No / No
Views / Downloads: 731 / 858
Version history: 13 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1010361 - addDirectMenuItem - add JMenuItem to JMenuBar
#1015291 - addPopupMenuItem