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

18
LINES

< > BotCompany Repo | #1004036 // jmenuItem

JavaX fragment (include)

sbool jmenuItem_newThreads;

static JMenuItem jmenuItem(fS text) {
  ret jMenuItem(text, null);
}

static JMenuItem jmenuItem(fS text, fO r) {
  ret swing(func -> JMenuItem {
    Pair<S, Int> p = jmenu_autoMnemonic(dropPrefix("[disabled] ", text));
    JMenuItem mi = new JMenuItem(p.a);
    if (startsWith(text, "[disabled] ")) disableMenuItem(mi);
    if (p.b != 0) mi.setMnemonic(p.b);
    mi.addActionListener(jmenuItem_newThreads
      ? actionListenerInNewThread(r)
      : actionListener(r));
    ret mi;
  });
}

Author comment

Began life as a copy of #1003661

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004036
Snippet name: jmenuItem
Eternal ID of this version: #1004036/5
Text MD5: 1e0f4fafb61028bde46db26e608dfd32
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-02-15 13:04:43
Source code size: 536 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 693 / 687
Version history: 4 change(s)
Referenced in: #1004448 - jmenuitem - synonym of jmenuItem
#1006523 - jCheckBoxMenuItem
#1006654 - Standard functions list 2 (LIVE, continuation of #761)