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

18
LINES

< > BotCompany Repo | #1014284 // getAWTFrame (get Frame of Swing component)

JavaX fragment (include)

1  
static Frame getAWTFrame(fO _o) {
2  
  ret swing(func -> Frame {
3  
    O o = _o;
4  
    /*
5  
    ifdef HaveProcessing
6  
      if (o instanceof PApplet) o = ((PApplet) o).getSurface();
7  
    endifdef
8  
    */
9  
    if (o instanceof ButtonGroup) o = first(buttonsInGroup((ButtonGroup) o));
10  
    if (!(o instanceof Component)) null;
11  
    Component c = (Component) o;
12  
    while (c != null) {
13  
      if (c instanceof Frame) return (Frame) c;
14  
      c = c.getParent();
15  
    }
16  
    null;
17  
  });
18  
}

Author comment

Began life as a copy of #1001428

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: #1014284
Snippet name: getAWTFrame (get Frame of Swing component)
Eternal ID of this version: #1014284/3
Text MD5: 17c5c6efae1fca1a3e0e7daf83381115
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-19 23:08:17
Source code size: 481 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 566 / 641
Version history: 2 change(s)
Referenced in: [show references]