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

13
LINES

< > BotCompany Repo | #1034024 // jOnDemand - generate component only when shown - computes in AWT thread

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

Transpiled version (14126L) is out of date.

static SingleComponentPanel lambda0Like jOnDemand(IF0<JComponent> makeComponent) {
  SingleComponentPanel scp = singleComponentPanel();
  bindToComponent(scp, -> {
    if (!scp.isEmpty()) ret;
    
    try {
      scp.setComponent(makeComponent?!);
    } catch print e {
      scp.setComponent(jscroll(jFastLogView_noWrap(renderStackTrace(e)));
    }
  }, null);
  ret scp;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034024
Snippet name: jOnDemand - generate component only when shown - computes in AWT thread
Eternal ID of this version: #1034024/5
Text MD5: 52562881a434bfacead2179acafa5b89
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-12-15 21:21:15
Source code size: 387 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 121 / 192
Version history: 4 change(s)
Referenced in: [show references]