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

17
LINES

< > BotCompany Repo | #1001733 // setFrameTitle

JavaX fragment (include)

1  
static <A> A setFrameTitle(A c, fS title) {
2  
  final Frame f = getAWTFrame(c);
3  
  if (f != null) swing { f.setTitle(title); }
4  
  ret c;
5  
}
6  
7  
static <A extends Component> A setFrameTitle(S title, A c) {
8  
  ret setFrameTitle(c, title);
9  
}
10  
11  
// magically find a field called "frame" in main class :-)
12  
static JFrame setFrameTitle(S title) {
13  
  O f = getOpt(mc(), "frame");
14  
  if (f instanceof JFrame)
15  
    ret setFrameTitle((JFrame) f, title);
16  
  ret null;
17  
}

Author comment

Began life as a copy of #1001439

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1001733
Snippet name: setFrameTitle
Eternal ID of this version: #1001733/7
Text MD5: 1b03930ac90440aa04c0564b4a2cf09a
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-23 19:09:41
Source code size: 458 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 871 / 1150
Version history: 6 change(s)
Referenced in: [show references]