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

16
LINES

< > BotCompany Repo | #1010361 - addDirectMenuItem - add JMenuItem to JMenuBar

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

Libraryless. Click here for Pure Java version (3021L/18K).

static void addDirectMenuItem(JMenuBar mb, S text, O action) {
  if (mb != null) swing {
    addDirectMenuItem(mb, directJMenuItem(text, action));
  }
}

static void addDirectMenuItem(Component c, S text, O action) {
  addDirectMenuItem(addMenuBar(c), text, action);
}

svoid addDirectMenuItem(JMenuBar mb, JMenuItem menuItem) {
  if (mb != null) swing {
    mb.add(menuItem);
    revalidate(mb);
  }
}

Author comment

Began life as a copy of #1005735

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1010361
Snippet name: addDirectMenuItem - add JMenuItem to JMenuBar
Eternal ID of this version: #1010361/5
Text MD5: e58570fab1348638ae61ddc3f7636331
Transpilation MD5: 40489835bfab8fa23941536a7b3b1ba6
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-06 13:33:20
Source code size: 417 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 331 / 350
Version history: 4 change(s)
Referenced in: [show references]