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

19
LINES

< > BotCompany Repo | #1028020 // JMenuItem bindToComponent Test with JTattoo fix attempt (doesn't work)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 1177K of libraries. Click here for Pure Java version (7632L/53K).

!7

static JMenuItem item;

p {
  jtattoo_mcWin();
  JDesktopPane desktop = jDesktopPane();
  showFrame(desktop);
  JInternalFrame f = addInternalFrame(desktop, "Test");
  item = jMenuItem("Hello");
  embedded void attachListener() {
    bindToComponent(item, r { print("Showing") }, r {
      print("Hiding, attaching listener again");
      attachListener();
    });
  }
  attachListener();
  addMenu(f, "Menu", item);
}

Author comment

Began life as a copy of #1016723

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

-
Snippet ID: #1028020
Snippet name: JMenuItem bindToComponent Test with JTattoo fix attempt (doesn't work)
Eternal ID of this version: #1028020/3
Text MD5: 91e7f494dbc7b47fb0935128df4d9136
Transpilation MD5: 1b48684a43e155188c5883fa51017da5
Author: stefan
Category: javax / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-05-03 20:55:25
Source code size: 440 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 231 / 835
Version history: 2 change(s)
Referenced in: