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

1  
!7
2  
3  
static JMenuItem item;
4  
5  
p {
6  
  jtattoo_mcWin();
7  
  JDesktopPane desktop = jDesktopPane();
8  
  showFrame(desktop);
9  
  JInternalFrame f = addInternalFrame(desktop, "Test");
10  
  item = jMenuItem("Hello");
11  
  embedded void attachListener() {
12  
    bindToComponent(item, r { print("Showing") }, r {
13  
      print("Hiding, attaching listener again");
14  
      attachListener();
15  
    });
16  
  }
17  
  attachListener();
18  
  addMenu(f, "Menu", item);
19  
}

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: 232 / 839
Version history: 2 change(s)
Referenced in: [show references]