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

13
LINES

< > BotCompany Repo | #1001428 // getFrame (get frame of Swing component)

JavaX fragment (include)

static JFrame getFrame(fO _o) {
  ret swing(func -> JFrame {
    O o = _o;
    if (o instanceof ButtonGroup) o = first(buttonsInGroup((ButtonGroup) o));
    if (!(o instanceof Component)) null;
    Component c = (Component) o;
    while (c != null) {
      if (c instanceof JFrame) return (JFrame) c;
      c = c.getParent();
    }
    null;
  });
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001428
Snippet name: getFrame (get frame of Swing component)
Eternal ID of this version: #1001428/4
Text MD5: 4503f9bd070867a935cce73c925767c7
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-07-24 17:52:05
Source code size: 361 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 824 / 1465
Version history: 3 change(s)
Referenced in: [show references]